[Top][All Lists]

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

Re: Raw strings (experimental patches inside)

From: Stephen J. Turnbull
Subject: Re: Raw strings (experimental patches inside)
Date: Sat, 11 Aug 2012 16:39:49 +0900

Vr Rm writes:

 > /.*\)$/
 > i.e. a parenthesis at the end of a line.  I can't do it!

What you have is a syntax error interactively.  It should work in a
program (the backslash is a no-op in a string).  /)$/ is good enough
and works in both interactive regexp search and in a program (unless
you need to match the whole line, in which case /^.*)$/ is what you
want (AFAIK Emacs doesn't guarantee longest match even today; I think
you can omit the "^" here, but I'd need to read the source to be

 > [I'm a member of a] population that would dramatically benefit if
 > they could actually use Emacs regular expressions.

Sure, but your blockage is that you aren't using Emacs REs, you're
trying to use some other kind of RE.

I think you might be helped a tiny bit by rawstrings, but I have to
admit that Stefan is right in your case: the problem is not the
proliferation of backslashes, it's that Emacs has a unique and
comparatively awkward syntax for regular expressions.  Rawstrings
might make it a little bit easier for you to adapt, though.

reply via email to

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