diff --git a/cpp/ycm/IdentifierUtils.cpp b/cpp/ycm/IdentifierUtils.cpp index e2d41deb..e35ed07a 100644 --- a/cpp/ycm/IdentifierUtils.cpp +++ b/cpp/ycm/IdentifierUtils.cpp @@ -37,13 +37,18 @@ const char *COMMENT_AND_STRING_REGEX = "|" "/\\*.*?\\*/" // C-style comments, '/* ... */' "|" - // Anything inside single quotes, '...', but mind the escaped quote and the - // escaped slash (\\) - "'(?:\\\\\\\\|\\\\'|.)*?'" + // Anything inside single quotes, '...', but mind: + // 1. that the starting single quote is not escaped + // 2. the escaped slash (\\) + // 3. the escaped single quote inside the string + // "(?