GNU’s implementation of these tools follows the POSIX standard, with added GNU extensions. The effect of the GNU extensions is that both the Basic Regular Expressions flavor and the Extended Regular Expressions flavor provide exactly the same functionality. The only difference is that BRE’s will use backslashes to give various characters a special meaning, while ERE’s will use backslashes to take away the special meaning of the same characters.
First, use RegexBuddy to define a regex or retrieve a regexp saved in a RegexBuddy library. Rely on RegexBuddy’s clear regex analysis, which is constantly updated as you build the pattern, rather than dealing with the cryptic regex syntax on your own. Select the GNU BRE flavor to make RegexBuddy behave just like GNU grep, ed or sed. Choose the GNU ERE flavor for egrep, awk and emacs. Detailed help on that syntax is always only a click away.
If you copied a regex written for another flavor of regular expressions, simply paste it into RegexBuddy, select the original flavor, and then convert the regex to GNU BRE or GNU ERE.
If you created a new regular expression, test and debug it in RegexBuddy before using it in your shell scripts. Test each regex in RegexBuddy’s safe sandbox without risking precious data. Quickly apply the regex to a wide variety of input and sample data, without having to produce that input through your script.