regular expression summery 

Subject:     Re: Can anybody make some summery here?
Newsgroups:  comp.unix.shell
Date:        Tue, 05 Dec 2006 08:58:55 GMT
>   when I use regular expression in the grep, perl, sed.
>   awk commands, I feel there are some differences in
>   them. Could anyone point them out or give me some
>   document to find what they are?

standard grep, expr, sed, more, vi, ed, pax, ex, csplit, nl use BRE (basic regular expressions). awk and grep -E (formerly egrep) use ERE (extended regular expressions). lex uses ERE with additions/restrictions.

See http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html for the standard for BRE and ERE.

Some implementations of those tools have extensions over the standard that you shouldn't use in scripts but should be described in their respective manuals.

perl has its own regexps (also found (similar) in tools that use the PCRE library as/or in php, newer TCLs, zsh, exim, apache and more). Run "perldoc perlre" or "man perlre".

vim has yet another sort of regular expressions that provide with the same functionalities as perl's but with a different syntax. AT&T ksh has AT&T regexps support…

Stephane CHAZELAS