[Top][All Lists]

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

Re: Unquoted special characters in regexps

From: Luc Teirlinck
Subject: Re: Unquoted special characters in regexps
Date: Thu, 2 Mar 2006 17:26:43 -0600 (CST)

Martin Rudalics wrote:

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

   Experience tells me that this should be probably written as

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

   but I'm not quite sure since `gud.el' is one of the few Emacs files that
   do not consistently use `\\]' to match a right bracket.

I do not see what this problem has to do with "\\]" vs ']'.

This seems to be just a case of forgetting to double up `\' for Lisp
syntax.  The actually intended regexo would seem to obviously be:

"\\(\\[[0-9]+] \\)* and so on.

The present regexp is valid, but the syntax it is looking for seems
bizarre.  On the other hand looking for things like:

"[123] [5] [2034] "

seems to make sense.



reply via email to

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