If I use this command it works as I need:
grep -o -e "{{ *[-_[:alnum:]]\+"
But if I use this one it throws error
grep -o -e "{{ *[_-[:alnum:]]\+"
Same as this one:
grep -o -e "{{ *[[:alnum:]-_]\+"
And this other:
grep -o -e "{{ *[[:alnum:]-\_]\+"
Seems that the [] from the RegExp can’t start nor end with _
Why?
Error is:
grep: Invalid range end
The error is related to the hypen
-:0-9means0123456789. But what is the meaning of_-[:alnum:]? Putting-as the first character disables this special meaning, so the first regexp works as expected.