in reply to Re: Matching string containing values between 0 and 100 inclusive
in thread Matching string containing values between 0 and 100 inclusive
That compiles a regexp pattern every run.
/^(\d+)(??{$^N >=0 && $^N <= 100 ? "" : "(?!)"})$/
should be
/^(\d+)(?(?{ $^N < 0 || $^N > 100 })(?!))$/
And match failures would be cheaper still as
/^(\d+)$(?(?{ $^N < 0 || $^N > 100 })(?!))/
|
|---|