I'm trying to abbreviate a regex in a grep. I need to match exactly six spaces followed by an alpha character. This works:
grep "^\s\s\s\s\s\s[[:alpha:]]" <filename>
This does not:
grep "^[[:space:]]{6}[[:alpha:]]" <filename>
What am I doing wrong?
[:space:]
matches tabs, newlines, vertical tabs, form feeds, carriage returns, and spaces, and[:blank:]
matches spaces and tabs.grep
,\s
is a synonym for[[:space:]]
, so the conversion is correct.