I'm not understanding something about print character class

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

I'm not understanding something about print character class

Post 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.
(2[Bb]|[^2].|.[^Bb])

That is the question.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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].
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post 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:]]
(2[Bb]|[^2].|.[^Bb])

That is the question.
Post Reply