emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unquoted special characters in regexps


From: Richard Stallman
Subject: Re: Unquoted special characters in regexps
Date: Fri, 03 Mar 2006 05:25:46 -0500

    your change would hardly help.  Consider the following expression from
    `gud-jdb-marker-filter':

             "\\(\[[0-9]+\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \
    \\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)"

    Experience tells me that this should be probably written as

             "\\(\\[[0-9]+\\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \
    \\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)"

\[ and \] in Lisp strings are equivalent to just [ and just ].  So I
think the current value is incorrect, and the [ needs to have \\ before it.

Meanwhile, the question we're discussing here is whether to write \\
before the ].  That is harmless, and the question is whether it makes
things clearer or more confusing.  The problem is that usually it
makes things clearer, but occasionally people could get confused when
\\ is last in a character alternative.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]