![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
What do you mean by "exactly" exactly?
Do you mean you only want a match if the pattern matches the whole string not just part of it? You do that by anchoring the pattern to the beginning and end /^\+\d\d\d\d\d\d$/. Note that the $ anchor actually permits a newline at the end of the string. If this bothers you then use \Z instead. As others have pointed out /^\+\d\d\d\d\d\d$/ is probably more tidy as /^\+\d{6}$/. (Oh, and BTW there was a spurious 's' in your OP - you should probably go update it.) In reply to Re: Pattern mattching
by nobull
|
|