fixed regex escaping bug, keywords with params are now no longer recognized if followed by an opening parenthesis

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@922 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-05-31 22:48:39 +00:00
parent bcfc87def5
commit 06016ac952
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -422,9 +422,11 @@ String make_non_capturing(const String& re) {
String ret;
bool escape = false, bracket = false, capture = false;
FOR_EACH_CONST(c, re) {
if (capture && c != _('?')) {
// change this capture into a non-capturing "(" by appending "?:"
ret += _("?:");
if (capture) {
if (c != _('?')) {
// change this capture into a non-capturing "(" by appending "?:"
ret += _("?:");
}
capture = false;
}
if (escape) { // second char of escape sequence