Next: Accessing Matched Text Using Match Data, Previous: Regular Expression Searching in Programs, Up: Searching and Replacing [Index]
Emacs keeps track of the start and end positions of the segments of text found during a search; this is called the “match data”.
All functions are allowed to overwrite the match data unless they’re explicitly documented not to do so. A consequence is that functions that are run implicitly in the background should likely save and restore the match data explicitly.