in reply to Re: pattern match
in thread pattern match
Your regexp would match both "complex.12" and "complex.120", because though it is only looking for "complex." followed by two digits, it doesn't exclude anything that exceeds the minimum criteria.
Perhaps you meant to say:
m/^complex\.\d{2}$/
...or...
m/\bcomplex\.\d{2}(?!\d)/
The first example requires that the string contain nothing at all besides "complex.nn" (where nn is two digits). The second example allows the string to contain additional stuff, but requires that the "complex.nn" tag be clearly bounded by a word boundry on the left, and a digit-boundry on the right.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: pattern match
by prasadbabu (Prior) on Oct 26, 2004 at 16:24 UTC |