in reply to Conditionals within Regex
But you can clean it up a little:
print "match\n" if /(\d{1,3})%(?(?{$1>91}).?|(?!.?))/;
I think .? is probably better than .* and you don't need the (?: ) construct around your "yes-pattern" in the conditional.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Conditionals within Regex
by jlf (Scribe) on Aug 09, 2002 at 21:27 UTC |