]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use one instead of two regexes. 13071/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 13 Dec 2021 20:40:37 +0000 (13:40 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 14 Dec 2021 14:41:32 +0000 (07:41 -0700)
doc/doxygen/scripts/filter

index cb4757b44e2d7b7162590d1bd00a1e88235548f5..b8c293c8ddc450c3bec8b83935ff699664048a38 100755 (executable)
@@ -26,11 +26,11 @@ while (<>)
     ########################################################
 
 
-    # make sure we can just write $...$ for formulas.
-    s/\$/\@f\$/g;
-
-    # however, undo that change if the dollar sign was escaped with a backslash
-    s/\\\@f\$/\$/g;
+    # Make sure we can just write $...$ for formulas, except if
+    # the dollar sign was escaped with a backslash (use negative
+    # look-behind to detect that case, using (?<!\\) to make sure
+    # the preceding character -- if there is any -- is not a backslash):
+    s#(?<!\\)\$#\@f\$#g;
 
     # We don't let doxygen put everything into a namespace
     # dealii. consequently, doxygen can't link references that contain an

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.