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>
// 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