Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to contruct a regular expression that matches when the first charater *is* a DLE and the second character is anything but a DLE. I'm having trouble, because I doubt that variables are interpolated in a character class:use constant DLE => 0x10;
I'd be interested in any alternatives, as long as the DLE is defined symbolically and not "hard coded". Thanks !my $dle = chr(DLE); $msg =~ /\A$dle[^$dle]/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Interpolation in character class
by merlyn (Sage) on Oct 02, 2003 at 16:37 UTC | |
|
Re: Interpolation in character class
by dragonchild (Archbishop) on Oct 02, 2003 at 16:49 UTC | |
by Anonymous Monk on Oct 02, 2003 at 17:48 UTC | |
by dragonchild (Archbishop) on Oct 02, 2003 at 18:01 UTC | |
|
Re: Interpolation in character class
by Aristotle (Chancellor) on Oct 02, 2003 at 20:23 UTC | |
|
Re: Interpolation in character class
by sandfly (Beadle) on Oct 02, 2003 at 20:18 UTC | |
|
Re: Interpolation in character class
by Anonymous Monk on Oct 02, 2003 at 18:03 UTC |