in reply to RegExp Pattern Matching Behavior
Your issue is that you expect [3-30] to match numbers 3-30, when you are performing what come down to complex string comparisons. The result of that particular group would be matching the character 3 (actually the range 3-3) or the character 0. If you substituted /d{1,2}, you would match any 1 or 2 digit sequence. If you really mean 3-30, you could use the more complex (?:[3-9]|[1-2]\d|30). See perlreftut for more instruction on using regular expressions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RegExp Pattern Matching Behavior
by perlpal (Scribe) on Jun 25, 2009 at 14:37 UTC | |
by kennethk (Abbot) on Jun 25, 2009 at 14:44 UTC | |
by perlpal (Scribe) on Jun 25, 2009 at 14:50 UTC |