[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Substring matched by regex
From: |
Nikos Apostolakis |
Subject: |
Re: Substring matched by regex |
Date: |
Sun, 13 Jan 2008 04:13:54 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
Aaron Maxwell <amax@redsymbol.net> writes:
> In a function, how do I get the value of a string matched by a regex?
>
Is `match-string' what you're looking for?
,----[ C-h f match-string RET ]
| match-string is a compiled Lisp function in `subr.el'.
| (match-string NUM &optional STRING)
|
| Return string of text matched by last search.
| NUM specifies which parenthesized expression in the last regexp.
| Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
| Zero means the entire text matched by the whole regexp or whole string.
| STRING should be given if the last search was by `string-match' on STRING.
|
| [back]
`----
Nikos
> Thanks much.
>