[ale] regex question?
Joseph A Knapka
jknapka at earthlink.net
Sat Mar 16 14:42:52 EST 2002
Fletch wrote:
>
> >>>>> "Joseph" == Joseph A Knapka <Joseph> writes:
>
> Joseph> Fletch wrote:
> >> >>>>> "esoteric" == esoteric <Geoffrey> writes:
> >>
> >> [...]
> >>
> >> >> '03/(19|20)/02'
>
> Joseph> This will match 03/120/02 or 03/190/02. Re operators bind
>
> lemur:~ 448> echo '03/19/02' | egrep '03/(19|20)/02' 12:10:04
> 03/19/02
> lemur:~ 449> echo '03/190/02' | egrep '03/(19|20)/02' 12:11:19
> lemur:~ 450> echo '03/120/02' | egrep '03/(19|20)/02' < 1 > 12:11:23
> lemur:~ 451> echo '03/20/02' | egrep '03/(19|20)/02' < 1 > 12:11:33
> 03/20/02
> lemur:~ 452> echo '03/12/02' | egrep '03/(19|20)/02' 12:11:39
> lemur:~ 453> < 1 > 12:11:40
How interesting. Is this behavior possibly different in
Gnu grep vs other greps? For some reason I got into the
habit a long time ago of always explicitly parenthesizing
stuff that I used on either side of the | operator.
Apparently that's just an entrenched habit that has
no basis in reality, but I can't understand now why
I developed the habit.
Oh well.
Cheers,
-- Joe
Using open-source software: free.
Pissing Bill Gates off: priceless.
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list