vansance has asked for the wisdom of the Perl Monks concerning the following question:
Later on I test the message against the regex, and it works for all expected values, except for '0'.Readonly my $REGEX => qr/^\s*([0-9]|\*|\#)\s*$/;
I have tested this exact code as a command line perl script, and had no trouble with it at all. I have also put in all kinds of debug statements to see if anything funky is being attached to the form parameter, and i have stripped null, and all spaces just for good measure to no avail.if ( $message =~ $REGEX ) { do_something($1); } else { do_something_else(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Weird mod_perl Regex '0' behavior.
by mr_mischief (Monsignor) on Sep 25, 2008 at 01:20 UTC | |
by vansance (Initiate) on Sep 25, 2008 at 15:19 UTC | |
by perrin (Chancellor) on Sep 25, 2008 at 17:25 UTC | |
by vansance (Initiate) on Sep 25, 2008 at 17:54 UTC | |
by perrin (Chancellor) on Sep 25, 2008 at 18:15 UTC | |
|
Re: Weird mod_perl Regex '0' behavior.
by GrandFather (Saint) on Sep 25, 2008 at 00:40 UTC | |
by moritz (Cardinal) on Sep 25, 2008 at 07:00 UTC | |
by GrandFather (Saint) on Sep 25, 2008 at 07:12 UTC |