开发者

What regular expressions does c-x c-f (opening a file) in Emacs accept?

开发者 https://www.devze.com 2023-03-20 06:26 出处:网络
I know that it will accept \'*\' in file names, but standard regular expression operators such as \'.\' or character classes do not work. 开发者_Python百科 I thought this would be something that I wou

I know that it will accept '*' in file names, but standard regular expression operators such as '.' or character classes do not work. 开发者_Python百科 I thought this would be something that I would easily find online but after about 15 min of searching, I could not find an answer to my question to my dismay.


From the Emacs manual "Visiting Files" section:

If the file name you specify contains shell-style wildcard characters, Emacs visits all the files that match it. (On case-insensitive filesystems, Emacs matches the wildcards disregarding the letter case.) Wildcards include ‘?’, ‘*’, and ‘[...]’ sequences.

So these are not regexps; they are simple shell-style wildcards. ? matches any single character, * matches zero or more characters, and [abc] matches any of the characters a, b, or c.

0

精彩评论

暂无评论...
验证码 换一张
取 消