in reply to $1 and regex


The quantifier + matches "one or more times". Therefore the second .+ will match any following characters following "to" up to the last digit. Try something like this instead:     m/(\d+)\s+to\s+(\d+)/i;

--
John.

Replies are listed 'Best First'.
Re: Re: $1 and regex
by tlhf (Scribe) on Aug 28, 2002 at 02:07 UTC
    While the + quantifier is often described as matching "one or more times", this description conflicts with one's inner hacker. As it is greedy, surly it should be written as something along the lines of "matching more or one times".

    tlhf
    Just trying to make things legible.