in reply to Re^2: Pattern mattching
in thread Pattern mattching

But you said it is fixed to "six digits". This should work, for any number of digits:
$match = $str =~ /^\+\d+/;
Regards,
Edward

Replies are listed 'Best First'.
Re^4: Pattern mattching
by Anonymous Monk on May 30, 2005 at 07:32 UTC
    What I ment to say was that it returns true even if there are more that 6 digits. I need to validate exactly six (6) digits.
      Then you need another anchor.
      /^\+\d{6}$/


      holli, /regexed monk/