4 ms·
There's also [:blank:], which is just space and tab. Both I think are perfectly readable and reasonable options that communicate intent nicely.
by nerdponx 11mo ago
There's also [:blank:], which is just space and tab. Both I think are perfectly readable and reasonable options that communicate intent nicely.
- kazinator 11mo agoISO C99 says, of the isblank function (to which [:blank:] is related: The isblank function tests for any character that is a standard blank character or is one of a locale-specific set of characters for which isspace is true and that is used to separate words within a line of text. The standard blank characters are the following: space (’ ’), and horizontal tab (’\t’). In the "C" locale, isblank returns true only for the standard blank characters. [:blank:] is only the same thing as [\t ] (tab space) if you run your scripts and Awk and everything in the "C" locale.
- nerdponx 11mo agoInteresting, the GNU Grep manual describes both character classes as behaving as if you are in the C locale. I shouldn't have assumed it was the same as in the C standard!