Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Pattern mattching

by monkfan (Curate)
on May 30, 2005 at 07:25 UTC ( [id://461681] : note . print w/replies, xml ) Need Help??


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/