From e0383c9b8bd6f4e3d445d69690f84209cad42bb5 Mon Sep 17 00:00:00 2001 From: Kjell Rune Skaaraas Date: Mon, 7 Nov 2011 16:18:33 +0100 Subject: Give better error message when using unsupported lookbehinds in QRegExp Merge-request: 1456 Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qregexp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index ba1609f..e3a771a 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -66,6 +66,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, #define RXERR_DISABLED QT_TRANSLATE_NOOP("QRegExp", "disabled feature used") #define RXERR_CHARCLASS QT_TRANSLATE_NOOP("QRegExp", "bad char class syntax") #define RXERR_LOOKAHEAD QT_TRANSLATE_NOOP("QRegExp", "bad lookahead syntax") +#define RXERR_LOOKBEHIND QT_TRANSLATE_NOOP("QRegExp", "lookbehinds not supported, see QTBUG-2371") #define RXERR_REPETITION QT_TRANSLATE_NOOP("QRegExp", "bad repetition syntax") #define RXERR_OCTAL QT_TRANSLATE_NOOP("QRegExp", "invalid octal value") #define RXERR_LEFTDELIM QT_TRANSLATE_NOOP("QRegExp", "missing left delim") @@ -3231,6 +3232,9 @@ int QRegExpEngine::getToken() #endif case ':': return Tok_MagicLeftParen; + case '<': + error(RXERR_LOOKBEHIND); + return Tok_MagicLeftParen; default: error(RXERR_LOOKAHEAD); return Tok_MagicLeftParen; -- cgit v0.12