The stupid question is the question not asked | |
PerlMonks |
Re: Range of chars except oneby Juerd (Abbot) |
on Jan 19, 2002 at 21:49 UTC ( [id://140097]=note: print w/replies, xml ) | Need Help?? |
Until japhy's patch is implemented (japhy++ btw), you'll have to use two ranges (you can do that within a single character class). For clarity, I won't use variables, but the literal characters (\x00 .. \x1f) (I know \x00 can be written like \0, but i like consistency)
Another solution, but quite a bit slower, would be using a negative look-ahead assertion: Update (200201191932+0100) danger has a better solution: negative look-behind. This saves a lot of time, because only the characters that match the first range are subject for the assertion.
HTH. (Warning: untested code)
In Section
Seekers of Perl Wisdom
|
|