* About backslash in regexp
@ 2013-03-16 2:50 Xue Fuqiao
2013-03-16 8:28 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Xue Fuqiao @ 2013-03-16 2:50 UTC (permalink / raw)
To: help-gnu-emacs
I understand that the usual regexp special characters are not special
inside a character alternative. But in the definition of the function
`command-line-normalize-file-name':
(defun command-line-normalize-file-name (file)
[...]
(string-match "^[A-Za-z]:\\(\\\\[\\\\/]\\)" file) ; C:\/ or C:\\
[...]
There four backslashes in the `[ ... ]' construct here, why? Aren't
they duplicated?
--
Xue Fuqiao
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: About backslash in regexp
2013-03-16 2:50 About backslash in regexp Xue Fuqiao
@ 2013-03-16 8:28 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2013-03-16 8:28 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sat, 16 Mar 2013 10:50:16 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
>
> I understand that the usual regexp special characters are not special
> inside a character alternative. But in the definition of the function
> `command-line-normalize-file-name':
>
> (defun command-line-normalize-file-name (file)
> [...]
> (string-match "^[A-Za-z]:\\(\\\\[\\\\/]\\)" file) ; C:\/ or C:\\
> [...]
>
> There four backslashes in the `[ ... ]' construct here, why? Aren't
> they duplicated?
It's a bug, now fixed in the development sources. (That entire
function was dead wrong wrt DOS/Windows file names.) Thanks for
catching it.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-16 8:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-16 2:50 About backslash in regexp Xue Fuqiao
2013-03-16 8:28 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).