info-gnus-english
[Top][All Lists]
Advanced

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

About toothpicks (was Re: nnimap-split-fancy)


From: Štěpán Němec
Subject: About toothpicks (was Re: nnimap-split-fancy)
Date: Fri, 17 Dec 2010 18:30:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Tommy Kelly <tommy.kelly@verilab.com> writes:

> asjo@koldfront.dk (Adam Sjøgren) writes:

>> ... it helps
>> pinpointing where I have forgotten some \'s or something (I am used to
>> Perls regexp syntax, so remembering all the leaning toothpicks in Emacs
>> regexps is sometimes a problem :-))
>
> Yeah, me too. For example: why does the . in domain1.com require the
> "\\" when included in the fancy split approach, but no toothpicks at all
> are needed when the same string is included in the normal (non fancy)
> approach?
>
> At first I assumed it was because in the fancy approach the string is a regexp
> while in non-fancy it's just a plain string. But that's not true is it? The
> use of things like "^" and ".*"  in non-fancy shows it's a regexp too,
> no?

It's really simple. '.' matches anything except newline, including a
dot. If you want to match a literal dot, you need '\.', but inside lisp
strings, double quotes and backslashes must be escaped with a backslash,
so what you end up with is "\\.".

  Štěpán



reply via email to

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