[plug] Grep not following my regex
Richard Meyer
meyerri at westnet.com.au
Thu Sep 17 10:24:22 WST 2009
Seems like 2.5.1 is broken, it works under 2.5.2 - SUSE 10.3 ....
On Thu, 2009-09-17 at 10:10 +0800, Tim wrote:
> Yet we've still not solved why egrep -o '[0-9.]*' doesn't work but
> egrep -o '[0-9.]+' does!
> The . shouldn't be an issue as it's in brackets. And I used egrep to
> make sure * and + should work.
> (Also, I wasn't bothered if it matched ...3..45.6..3 for example).
>
> On my laptop. both work.
> $ grep -V
> GNU grep 2.5.3
>
> $ egrep -o '[0-9.]*'
> random 4343.34343
> 4343.34343
>
> $ egrep -o '[0-9.]+'
> random 4343.34343
> 4343.34343
>
>
> On the Fedora machine, the first doesn't.
>
> $ grep -V
> grep (GNU grep) 2.5.1
>
> $ egrep -o '[0-9.]*'
> random 4343.34343
>
> $ egrep -o '[0-9.]+'
> random 4343.34343
> 4343.34343
>
>
> Odd. Is it a bug in that grep version? (2.5.1)
>
> Thanks
>
> Tim
>
--
Richard Meyer
Necessity is the plea for every infringement of human freedom.
It is the argument of tyrants; it is the creed of slaves.
William Pitt, 1783
Linux Counter user #306629
More information about the plug
mailing list