I recently got into a friendly argument with Ghoti about what constitutes a regular expression in the comments to my answer to this question. I claimed that the following is a regular expression:
`[Rr]eading[Tt]est[Dd]ata`
Ghoti disagreed, claiming it is a file glob instead. The glob page on wikipedia claims that (emphasis mine):
Globs do not include syntax for the Kleene star which allows multiple repetitions of the preceding part of the expression; thus they are not considered regular expressions, which can describe a larger set of regular languages over any given finite alphabet.
However, there is no citation for this claim, indicating that it is just a particular wikipedia editor's opinion.
The The Single UNIX ® Specification, Version 2, states that a Basic Regular Expression (BRE) can even be a single character:
An ordinary character is a BRE that matches itself: any character in the supported character set, except for the BRE special characters listed in BRE Special Characters .
So, what is the definition of a regular expression in the *nix world, and does that definition exclude file globs?
grep,sed, andawk. Vim uses its own variety, as does Perl.*has two different meanings in BRE and globs. Note: I don't think the term glob is used anywhere in the POSIX spec - it's called Pattern Matching instead and is described in the shell language chapter.extglobdoes include the ability to arbitrarily repeat sections, which means that technically it meets the definition of RegEx, though many people deny this because extglob's syntax is so radically different from BRE, ERE, PRCE and VimRE: repetition is indicated by prefix symbols rather than suffix symbols.