in reply to Re: How to use "less than" and "greater than" inside a regex for a $variable number
in thread How to use "less than" and "greater than" inside a regex for a $variable number
For example, how would one do something like this?
If I had something like that I could then plug in $var for $2.$string = "I have 5 apples, 6 oranges, and 8 limes."; #Match the oranges only if they are more than the apples #and fewer than the limes. $string =~ m/(\d+)\sapples.*(\d+)\soranges.*(\d+)\slimes(?{if (($1<$2) + && ($2<$3))})/g;
Blessings,
~Polyglot~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to use "less than" and "greater than" inside a regex for a $variable number
by AnomalousMonk (Archbishop) on Oct 02, 2012 at 03:18 UTC | |
by Polyglot (Chaplain) on Oct 04, 2012 at 19:42 UTC | |
by AnomalousMonk (Archbishop) on Oct 06, 2012 at 10:41 UTC | |
|
Re^3: How to use "less than" and "greater than" inside a regex for a $variable number
by AnomalousMonk (Archbishop) on Oct 02, 2012 at 05:24 UTC |