[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 06:23:55 +0100 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) |
Qiang <mcknight0219@gmail.com> 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))
--
__Pascal Bourguignon__