help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: Regular expression match


From: Timothy Schaeffer
Subject: RE: Regular expression match
Date: Thu, 5 Nov 2009 10:00:39 -0500

> Pascal J. Bourguignon wrote:
> > Qiang <address@hidden> writes:
> > 
> >> I am trying to use regular expression in Emacs. And I have question 
> > Using groups and match-string.  For example:
> > 
> > (when (re-search-forward "Vol.\(8\)")
> >    (match-string 1))
> 
> The regexp string should be "Vol\\.\\(8\\)"

And you can avoid emacs' regexp-in-strings hyperquoting with the rx macro.

(rx "Vol." (group "8")) = "Vol\\.\\(8\\)"

Tim S




reply via email to

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