:type 'string
:group 'dired)
-(defun file-expand-wildcards (pattern &optional full)
+(defun file-expand-wildcards (pattern &optional full regexp)
- "Expand wildcard pattern PATTERN.
- This returns a list of file names that match the pattern.
+ "Expand (a.k.a. \"glob\") file-name wildcard pattern PATTERN.
+ This returns a list of file names that match PATTERN.
+ The returned list of file names is sorted in the `string<' order.
-If PATTERN is written as an absolute file name,
-the expansions in the returned list are also absolute.
+PATTERN is, by default, a \"glob\"/wildcard string, e.g.,
+\"/tmp/*.png\" or \"/*/*/foo.png\", but can also be a regular
+expression if the optional REGEXP parameter is non-nil. In any
+case, the matches are applied per sub-directory, so a match can't
+span a parent/sub directory, which means that a regexp bit can't
+contain the \"/\" character.
+
- The list of files returned are sorted in `string<' order.
++The returned list of file names is sorted in the `string<' order.
+
- If PATTERN is written as an absolute file name, the values are
- absolute also.
++If PATTERN is written as an absolute file name, the expansions in
++the returned list are also absolute.
If PATTERN is written as a relative file name, it is interpreted
- relative to the current default directory, `default-directory'.
+ relative to the current `default-directory'.
The file names returned are normally also relative to the current
default directory. However, if FULL is non-nil, they are absolute."
(save-match-data