Regular Expressions/Shell Regular Expressions

The Unix shell recognises a glob syntax for use with filename substitution. With the extglob extension of ksh and bash, it is equivalent to a basic form of regular expression in expressiveness.

Differences from common regular expressions are:
 * The asterisk and hook operators mean different things.
 * The compliment bow is formed using the exclamation mark (!) in the POSIX standard, not a caret (^). Some shells, such as GNU bash, allow the caret to be used as an extension.
 * The extglob extensions are not standard. They are only available in Korn shell (enabled by default) and GNU bash (enabled via ).

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


 * For the general glob syntax, all POSIX "bourne-compatible" shells.
 * For the extglob part, Korn shell and bash.

Links

 * Bash Pattern Matching at gnu.org
 * Guide_to_Unix/Explanations/Quoting_and_Filename_Expansion