mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Simplify BRE.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5618 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c4075449be
commit
87bcc2eb1c
@ -1,6 +1,7 @@
|
|||||||
2002-11-12 Angus Leeming <leeming@lyx.org>
|
2002-11-12 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* ControlSpellchecker.C (check): fix crash
|
* ControlSpellchecker.C (check): fix crash
|
||||||
|
* biblio.C (escape_special_chars): simplify BRE.
|
||||||
|
|
||||||
2002-11-07 Edwin Leuven <leuven@fee.uva.nl>
|
2002-11-07 Edwin Leuven <leuven@fee.uva.nl>
|
||||||
|
|
||||||
|
@ -243,9 +243,11 @@ namespace {
|
|||||||
// These characters are literals when preceded by a "\", which is done here
|
// These characters are literals when preceded by a "\", which is done here
|
||||||
string const escape_special_chars(string const & expr)
|
string const escape_special_chars(string const & expr)
|
||||||
{
|
{
|
||||||
// Search for all chars .|*?+(){}[]^$\
|
// Search for all chars .|*?+(){}[^$]\
|
||||||
// Note that they must be escaped in the RE.
|
// Note that '[', ']' and '\' must be escaped.
|
||||||
boost::RegEx reg("[\\.\\|\\*\\?\\+\\(\\)\\{\\}\\[\\]\\^\\$\\\\]");
|
// 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
|
// $& is a perl-like expression that expands to all of the current match
|
||||||
// The '$' must be prefixed with the escape character '\' for
|
// The '$' must be prefixed with the escape character '\' for
|
||||||
|
Loading…
Reference in New Issue
Block a user