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

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

Re: Regular expression match


From: Pascal J. Bourguignon
Subject: Re: Regular expression match
Date: Thu, 05 Nov 2009 18:19:51 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Kevin Rodgers <address@hidden> writes:

> Pascal J. Bourguignon wrote:
>> Qiang <address@hidden> writes:
>> 
>>> Hi
>>>
>>> I am trying to use regular expression in Emacs. And I have
>>> question about how to return the matched item. For example,
>>> I want to match and return '8' in the string 'Vol.8'. How
>>> can I achieve that ?
>> Using groups and match-string.  For example:
>> (when (re-search-forward "Vol.\(8\)")
>>    (match-string 1))
>
> The regexp string should be "Vol\\.\\(8\\)"

Of course.  Sorry.

-- 
__Pascal Bourguignon__


reply via email to

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