Mercurial > hg > xemacs-beta
comparison man/lispref/searching.texi @ 1468:0f42689481f0
[xemacs-hg @ 2003-05-09 14:52:37 by stephent]
revert clobber match data <873cjoi38t.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Fri, 09 May 2003 14:52:43 +0000 |
parents | 1ccc32a20af4 |
children | c3cf7db99b98 |
comparison
equal
deleted
inserted
replaced
1467:e5da225ea2ca | 1468:0f42689481f0 |
---|---|
1056 text found during a regular expression search. This means, for example, | 1056 text found during a regular expression search. This means, for example, |
1057 that you can search for a complex pattern, such as a date in an Rmail | 1057 that you can search for a complex pattern, such as a date in an Rmail |
1058 message, and then extract parts of the match under control of the | 1058 message, and then extract parts of the match under control of the |
1059 pattern. | 1059 pattern. |
1060 | 1060 |
1061 Because the match data normally describe the most recent search only, | 1061 Because the match data normally describe the most recent successful |
1062 you must be careful not to do another search inadvertently between the | 1062 search only, you must be careful not to do another search inadvertently |
1063 search you wish to refer back to and the use of the match data. If you | 1063 between the search you wish to refer back to and the use of the match |
1064 can't avoid another intervening search, you must save and restore the | 1064 data. If you can't avoid another intervening search, you must save and |
1065 match data around it, to prevent it from being overwritten. | 1065 restore the match data around it, to prevent it from being overwritten. |
1066 | |
1067 To make it possible to write iterative or recursive code that repeatedly | |
1068 searches, and uses the data from the last successful search when no more | |
1069 matches can be found, a search or match which fails will preserve the | |
1070 match data from the last successful search. (You must not depend on | |
1071 match data being preserved in case the search or match signals an | |
1072 error.) If for some reason you need to clear the match data, you may | |
1073 use @code{(store-match-data nil)}. | |
1066 | 1074 |
1067 @menu | 1075 @menu |
1068 * Simple Match Data:: Accessing single items of match data, | 1076 * Simple Match Data:: Accessing single items of match data, |
1069 such as where a particular subexpression started. | 1077 such as where a particular subexpression started. |
1070 * Replacing Match:: Replacing a substring that was matched. | 1078 * Replacing Match:: Replacing a substring that was matched. |