in reply to Re^2: Recognizing numbers
in thread Recognizing numbers

Yes, that is correct, except is isn't more than 11, it's 11 or more. To elaborate, the first one is any digit, one or more times (greedy). The second is any non-whitespace character (letter, number, special char etc) a minimum of 11 times consecutively with no maximum specified (greedy).

Also, [0-9] can be simplified with a single \d.

Replies are listed 'Best First'.
Re^4: Recognizing numbers
by afoken (Chancellor) on Jul 28, 2015 at 14:25 UTC
    Also, [0-9] can be simplified with a single \d.

    In the old ASCII times: yes.

    Today: No.

    Unicode has more digits than [0-9]. You can limit the regular expression to match in ASCII mode using the /a or /aa options, this is documented in perlop.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Yes, but the /a modifier was not introduced until Perl 5.14 so if you need to run on an older perl than that and you want to match only Latin script numbers, you are back to [0-9] ....

      The way forward always starts with a minimal test.