in reply to RegExp Pattern Matching Behavior

My apologies to kennethk it appears I did not read the thread carefully enough and he has already stated what is written below.

[3-30] does not match line numbers 3 through 30. It matches a single character, either 3 or 0. Only one line $out2 has either a 3 or 0 as its line number, hence that is the one that is matching. To match the numbers 3 through 30, you need a regular expression like this: (?:[3-9]|[12]\d|30). To explain a bit:

Please see perlretut for a fuller explanation of each part of the regular expression.

Best, beth

Replies are listed 'Best First'.
Re^2: RegExp Pattern Matching Behavior
by perlpal (Scribe) on Jun 26, 2009 at 06:14 UTC

    to kennethk and beth ,

    thank you for the regexp and the explanation.It solved a really big logic error in my code!

    Cheers!