|
@@ -5638,21 +5638,20 @@ stacked delimiters is N. Escaping delimiters is not possible."
|
|
|
next (concat "\\(?:" nothing left next right "\\)+" nothing)))
|
|
|
(concat left "\\(" re "\\)" right)))
|
|
|
|
|
|
-(defvar org-match-substring-regexp
|
|
|
+(defconst org-match-substring-regexp
|
|
|
(concat
|
|
|
"\\(\\S-\\)\\([_^]\\)\\("
|
|
|
- "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
|
|
|
+ "\\(?:" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
|
|
|
"\\|"
|
|
|
- "\\(" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
|
|
|
+ "\\(?:" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
|
|
|
"\\|"
|
|
|
- "\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \t\r\n,:\"?<>~;./{}=()]+\\)\\)\\)")
|
|
|
+ "\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)")
|
|
|
"The regular expression matching a sub- or superscript.")
|
|
|
|
|
|
-(defvar org-match-substring-with-braces-regexp
|
|
|
+(defconst org-match-substring-with-braces-regexp
|
|
|
(concat
|
|
|
- "\\(\\S-\\)\\([_^]\\)\\("
|
|
|
- "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
|
|
|
- "\\)")
|
|
|
+ "\\(\\S-\\)\\([_^]\\)"
|
|
|
+ "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)")
|
|
|
"The regular expression matching a sub- or superscript, forcing braces.")
|
|
|
|
|
|
(defun org-make-link-regexps ()
|
|
@@ -6089,8 +6088,6 @@ by a #."
|
|
|
|
|
|
(defvar org-latex-and-related-regexp nil
|
|
|
"Regular expression for highlighting LaTeX, entities and sub/superscript.")
|
|
|
-(defvar org-match-substring-regexp)
|
|
|
-(defvar org-match-substring-with-braces-regexp)
|
|
|
|
|
|
(defun org-compute-latex-and-related-regexp ()
|
|
|
"Compute regular expression for LaTeX, entities and sub/superscript.
|