Why grep promt "Invalid end range"?

I have a file a :

 $ cat a abcd kaka 

when using the command:

 $ grep -e '[ad]' a abcd kaka 

This works well, but why is this command not suitable?

 $ grep -e '[\x61-\x74]' a grep: Invalid range end $ grep -e '[\u0061-\u0074]' a grep: Invalid range end 
+4
source share
1 answer

Assuming your version of grep supports PCRE ("Perl-compatible regular expressions"), you could try:

 grep -P '[\x61-\x74]' a 

This will return the expected result:

 abcd kaka 
+2
source

All Articles