[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "grep -o" skips some matching patterns
From: |
Roberto Gordo Saez |
Subject: |
Re: "grep -o" skips some matching patterns |
Date: |
Tue, 30 Dec 2003 22:56:17 +0100 |
User-agent: |
Mutt/1.5.4i |
On Tue, Dec 30, 2003 at 02:52:32PM -0500, Michael Elizabeth Chastain wrote:
> The rules are:
>
> (1) Left-most position.
> (2) At the same position, then longest match.
Oh, because of some strange reason i've (incorrectly) assumed that the
longest match was at the first priority. Sorry.
>
> A pattern which matches the empty string always succeeds at the
> beginning of the target, even when it matches an empty string at the
> beginning rather than the stuff you really want in the middle.
> Yes, this can be annoying.
>
> Maybe you want "[01]+" ?
Yes, i need to fix it. That was an example, the regular expresions that
i'm using are long and complex, so i think that i'll need some time to
review all of them with caution because of that silly mistake :-(
Thank you for the correction.
--
Roberto Gordo Saez - Free Software Engineer
Linalco "Especialistas en Linux y Software Libre"
http://www.linalco.com/ Tel: +34-914561700