Regular Expressions/Simple Regular Expressions

The Simple Regular Expression syntax is widely used on Unix based systems for the purposes of backwards compatibility. Most regular-expression-aware Unix utilities, such as grep and sed, use it by default while providing support for extended regular expressions with command line arguments (see below). This syntax is deprecated on POSIX compliant systems and should not be used by new utilities.

When simple regular expression syntax is being used, most characters, except metacharacters are treated as literal characters and match only themselves (for example, "a" matches "a", "(bc" matches "(bc", etc).

Examples
Examples:
 * "^[hc]at"
 * Matches hat and cat but only at the beginning of a line.
 * "[hc]at$"
 * Matches hat and cat but only at the end of a line.

Use in Tools
Tools and languages that utilize this regular expression syntax include:


 * Grep
 * sed