1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Improve regex to not trigger stack overflow

* lisp/textmodes/reftex-vars.el (reftex-label-regexps): Improve regex in
order not to trigger a stack overflow in regex matcher with unbalanced
brackets (bug#22146).
This commit is contained in:
Tassilo Horn 2015-12-13 19:41:58 +01:00
parent 93b1067949
commit 223b3f0d84

View file

@ -877,7 +877,7 @@ DOWNCASE t: Downcase words before using them."
"\\\\label{\\(?1:[^}]*\\)}"
;; keyvals [..., label = {foo}, ...] forms used by ctable,
;; listings, minted, ...
"\\[[^][]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
"\\[[^][]\\{0,2000\\}\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
"List of regexps matching \\label definitions.
The default value matches usual \\label{...} definitions and
keyval style [..., label = {...}, ...] label definitions. It is