> ‘\digit’ matches the same text that matched the digitth occurrence of a grouping (‘\( ... \)’) construct.
In other words, after the end of a group, the matcher remembers the beginning and end of the text matched by that group. Later on in the regular expression you can use ‘\’ followed by digit to match that same text, whatever it may have been.
The strings matching the first nine grouping constructs appearing in the entire regular expression passed to a search or matching function are assigned numbers 1 through 9 in the order that the open parentheses appear in the regular expression. So you can use ‘\1’ through ‘\9’ to refer to the text matched by the corresponding grouping constructs.
For example, ‘\(.*\)\1’ matches any newline-free string that is composed of two identical halves. The ‘\(.*\)’ matches the first half, which may be anything, but the ‘\1’ that follows must match the same exact text.
а есть ли какой-нибудь способ поймать некоторый набор символов в регекспе и использовать его вдальнейше вне данного регекспа, т.е. непосредственно в дальнейшем elisp коде.
как, например, в перле $var =~ /.*([a-z]+).+/; my capt = $1;
или использованием regexp ссылок только в контектсте того же regexp'a всё ограничивается?
спасибо.