Is this a regex bug?

Tim Kientzle tim at kientzle.com
Sun Jan 26 21:10:33 UTC 2014


Try without the grep:

$ echo '-m'
-m
$ echo '-n'
$ echo '-o'
-o
$ man echo




On Jan 26, 2014, at 1:04 PM, rank1seeker at gmail.com wrote:

> Or am I crazy?
> 
> echo '-m' | egrep '^\-[[:alnum:]]+$'
> echo '-n' | egrep '^\-[[:alnum:]]+$'
> echo '-o' | egrep '^\-[[:alnum:]]+$'
> 
> Guess what?
> Only middle one, '-n' doesn't match it.
> Is this an RE bug or I clearly ain't seeing obvious?!
> 
> echo '-n' | egrep '^\-[0-9A-Za-z]+$'
>    Doesn't work either
> 
> 9.2-RELEASE-p3  i386
> 
> 
> Domagoj Smolčić
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
> 
> 



More information about the freebsd-hackers mailing list