in reply to Re: Recognizing 3 and 4 digit number
in thread Recognizing 3 and 4 digit number

I put a backslash s in front of the backslash d and it works, but puts a percent 20 in the url. It still works but there must be another way. Thank you.

Replies are listed 'Best First'.
Re^3: Recognizing 3 and 4 digit number
by 1nickt (Canon) on Jan 02, 2017 at 02:12 UTC

    If you don't want the space in the substitution, don't include it in the capture group!

    $ perl -E' my $re = qr/ \s ( \d{3,4} ) /x; say ">$1<" if " 5678" =~ /$re/; ' >5678<


    The way forward always starts with a minimal test.
Re^3: Recognizing 3 and 4 digit number
by Anonymous Monk on Jan 02, 2017 at 02:05 UTC
    Impossible :) nothing in that snippet does "value" encoding/escapeing