in reply to Interpolation in character class
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.
|
|---|