[Top][All Lists]

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

Re: Converting a non-escaped regexp to an escaped version

From: Joost Kremers
Subject: Re: Converting a non-escaped regexp to an escaped version
Date: 7 Jun 2007 14:35:06 GMT
User-agent: slrn/ (Linux)

Nikolaj Schumacher wrote:
> On 2007-06-07, at 14:32, HippoMan wrote:
>> During development of elisp code that I'm writing, I test regular
>> expressions via the interactive use of M-x re-search-forward.  Once
>> I've come up with a regexp that works, I often will want
>> to yank it into my elisp code, for example, into a call to
>> `match-string'.
> Not really a solution for your specific problem, but I'd suggest  
> using `re-builder' for that.

it can be a solution, though: re-builder supports different forms of input
syntax. by default, it requires you to escape backslashes, so that when you
type C-c C-w to copy the regexp to the kill-ring, you get it with every
backslash escaped.

if you don't want to type the double backslashes, you can change
re-builders input syntax (with C-c TAB)from "read" to "string". then,
before typing C-c C-w change it back again to "read": re-builder will
automatically adjust the syntax and escape all backslashes for you.

it's a pretty neat package, that re-builder.

Joost Kremers                                      address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht

reply via email to

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