mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-27 01:01:52 -07:00
(Simple Match Data): Warn about match data being set anew by every search.
This commit is contained in:
parent
892eb23701
commit
5345f90dfa
1 changed files with 6 additions and 0 deletions
|
|
@ -1264,6 +1264,12 @@ subexpression is numbered 1, the second 2, and so on. Only regular
|
|||
expressions can have subexpressions---after a simple string search, the
|
||||
only information available is about the entire match.
|
||||
|
||||
Every successful search sets the match data. Therefore, you should
|
||||
query the match data immediately after searching, before calling any
|
||||
other function that might perform another search. Alternatively, you
|
||||
may save and restore the match data (@pxref{Saving Match Data}) around
|
||||
the call to functions that could perform another search.
|
||||
|
||||
A search which fails may or may not alter the match data. In the
|
||||
past, a failing search did not do this, but we may change it in the
|
||||
future. So don't try to rely on the value of the match data after
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue