Page 1 of 1

I'm not understanding something about print character class

Posted: Thu Aug 28, 2014 5:56 pm
by kengrubb
Why is this RE
^[[:print:]]

not equivalent to this RE?
^.

The RE ^[[:print:]] finds blank lines (^$), but I'm confused as to why.

Posted: Thu Aug 28, 2014 10:02 pm
by ben_josephs
I don't know why either.

[[:print:]] seems to match TAB [\x09], LF [\x0A], VT [\x0B], FF [\x0C] and CR [\x0D].

I believe that is wrong, and that (of ASCII characters) [[:print:]] should only match space [\x20] and graphic characters [\x21-\x7E].

Posted: Mon Nov 24, 2014 11:03 pm
by kengrubb
It’s déjà vu all over again

I just now rediscovered this issue

Lesson learned is to use [\x20-\x7E] rather than [[:print:]]