my $dle = sprintf "\\%03o", DLE; my $regex = "\\A[$dle][^$dle]"; $regex = qr/$regex/; if ($string =~ $regex) { ... }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: Interpolation in character class
by merlyn
in thread Interpolation in character class
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |