procmail
[Top] [All Lists]

Re: Matching Word Boundaries with \< and \>, and Extended Character Sets

1999-04-03 00:18:22
"David W. Tamkin" <dattier(_at_)Mcs(_dot_)Net> writes:
Philip Guenther wrote,

| Actually, \< and \> are internally treated as shortcuts for the
| character class [^a-zA-Z0-9_] ...

Aren't they equivalent to ([^a-zA-Z0-9]|$) ?

<grimace>

Yes.

Character classes, inverted or otherwise, cannot normally match
newlines.  However, procmail cheats with \< and will actually match a
newline with the internal character class that it generates, rather
than having to use an alternation.  \< is therefore slightly faster
to match than the equivalent ([^a-zA-Z0-9]|$).


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>