chickadee » regex » glob->regexp

glob->regexp PATTERN #!optional SRE?procedure

Converts the file-pattern PATTERN into a regular expression.

(glob->regexp "foo.*")
=> "foo\..*"

PATTERN should follow "glob" syntax. Allowed wildcards are

*
[C...]
[C1-C2]
[-C...]
?

glob->regexp returns a regular expression object if the optional argument SRE? is false or not given, otherwise the SRE of the computed regular expression is returned.