in reply to Re: RegExp Pattern Matching Behavior
in thread RegExp Pattern Matching Behavior

With respect to 3-30 , i meant matching numbers between 3 and 30. In effect , i would be matching lines with line numbers from 3 to 30.

Replies are listed 'Best First'.
Re^3: RegExp Pattern Matching Behavior
by kennethk (Abbot) on Jun 25, 2009 at 14:44 UTC
    You are still not using <code> tags. You've been around long enough you should know better.

    As I stated above, the expression (?:[3-9]|[1-2]\d|30) will match the numbers 3 through 30 inclusive. I used a non-capturing group to isolate the ors from the surrounding expressions and include three terms: [3-9] matches single digits 3-9; [1-2]\d matches single digits 1 or 2 followed by any digit, meaning 10-29; 30 matches 30.


      Apologies, have done the needful. :)