I use RegEx Buddy to prototype and debug my regular expressions. RegEx Buddy allows me to choose between a number of different regular expression engine types (.NET, Java, Perl, GNU BRE, GNU ERE, POSIX, BRE, POSIX ERE etc).
What regular expression engine does bash use (for example in if
and case
statements)? I'm running Centos 5.5 32 bit and bash 3.2.25(1):
[kevin@mon01 scratch]$ bash --version
GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
I'm guessing it'll be GNU BRE or GNU ERE?
zsh
supports PCRE with[[ sth =~ regex ]]
(enable it withsetopt re_match_pcre
).