Fix handling of escaped \ in char or string.

This commit is contained in:
peter50216 2013-03-14 12:41:20 +08:00
parent 9b2a214cbe
commit 6a0525254e

View File

@ -31,10 +31,10 @@ const char *COMMENT_AND_STRING_REGEX =
"/\\*.*?\\*/" // C-style comments, '/* ... */'
"|"
// Anything inside single quotes, '...', but mind the escaped quote
"'(?:\\\\'|.)*?'"
"'(?:\\\\\\\\|\\\\'|.)*?'"
"|"
// Anything inside double quotes, "...", but mind the escaped double quote
"\"(?:\\\\\"|.)*?\"";
"\"(?:\\\\\\\\|\\\\\"|.)*?\"";
const char *IDENTIFIER_REGEX = "[_a-zA-Z]\\w*";