5 ms·
To be pedantic: You're conflating the syntax of regular exprssions, with the (computer science) concept. Glob patterns are a kind of very resticted regular pexr
by Per_Bothner 3y ago
To be pedantic: You're conflating the syntax of regular exprssions, with the (computer science) concept. Glob patterns are a kind of very resticted regular pexressions. Ksh extended the glob syntax so it has the full power of regular expressions in the computer science sense - though without all the extensions of modern regular expressions.
- teddyh 3y agoNo, globs are not regular expressions. “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 the full set of regular languages over any given finite alphabet.” — <https://en.wikipedia.org/w/index.php?title=Glob_(programming)&oldid=1177361783#Compared_to_regular_expressions https://en.wikipedia.org/w/index.php?title=Glob_(programming...>
- neuromanser 3y agoYou're right, normal globs are not regular expressions regardless of syntax. Parent is correct too, ksh globs are regular expressions. See shopt -s extglob in bash, setopt kshglob in zsh (extendedglob for zsh's native, IMO inferior, quantifier syntax).