From the A Brief Introduction to Regular Expressions
[:blank:] matches a space or a tab.
[:space:] matches whitespace characters (space and horizontal tab).
To me both definitions are the same and I was wondering if they are really duplicates?
If they are different, what are the differences?
For the GNU tools the following from grep.info
applies:
[:blank:]
Blank characters: space and tab.
[:space:]
Space characters: in the 'C' locale, this is tab, newline,
vertical tab, form feed, carriage return, and space.
You can find the section with this command:
info grep 'Regular Expressions' 'Character Classes and Bracket Expressions'
A better explanation of what they each match is available here
The biggest difference is that [:space:]
will also match items like new line characters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With