]> git.lyx.org Git - features.git/commitdiff
Simplify BRE.
authorAngus Leeming <leeming@lyx.org>
Tue, 12 Nov 2002 13:53:47 +0000 (13:53 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 12 Nov 2002 13:53:47 +0000 (13:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5618 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/biblio.C

index aaea7abd251f4263f077d5b705b978d7f4cec190..8d99afc6ade4cfcba3ff87ca69525fb18658ca24 100644 (file)
@@ -1,6 +1,7 @@
 2002-11-12  Angus Leeming  <leeming@lyx.org>
 
        * ControlSpellchecker.C (check): fix crash
+       * biblio.C (escape_special_chars): simplify BRE.
 
 2002-11-07  Edwin Leuven  <leuven@fee.uva.nl>
 
index 01f1d07e654691b438a2c3c4a3ca672fc7ab4aa4..f4d978cc88fdbf318e13cc55b48b05aec7b57c6b 100644 (file)
@@ -243,9 +243,11 @@ namespace {
 // These characters are literals when preceded by a "\", which is done here
 string const escape_special_chars(string const & expr)
 {
-       // Search for all chars .|*?+(){}[]^$\
-       // Note that they must be escaped in the RE.
-        boost::RegEx reg("[\\.\\|\\*\\?\\+\\(\\)\\{\\}\\[\\]\\^\\$\\\\]");
+       // Search for all chars .|*?+(){}[^$]\
+       // Note that '[', ']' and '\' must be escaped.
+       // This is a limitation of boost::regex, but all other chars in BREs
+       // are assumed literal.
+        boost::RegEx reg("[.|*?+(){}^$\\[\\]\\\\]");
 
        // $& is a perl-like expression that expands to all of the current match
        // The '$' must be prefixed with the escape character '\' for