https://bugs.kde.org/show_bug.cgi?id=385544

--- Comment #3 from Thomas Fischer <fisc...@unix-ag.uni-kl.de> ---
(In reply to Sergio Martins from comment #2)
> One option is to link to pcre or Qt and validate the string.
Using pcre would have the advantage of being a 'lighter' dependency than Qt and
maybe more generally already installed. Using Qt would have the advantage to be
more 'realistic'.

> Additionally, I think it should warn if you're not using C++11
> raw-string-literals, which makes code much less error prone.

If it would be technically possible, make the dependency on pcre or Qt
compile-time optional, i.e. a configuration/build flag.
Coded in clazy could be some basic checks that would be applied before any
pcre/Qt tests and be available even if pcre/Qt support would be disabled. Those
basic checks could be:
- Correct usage of raw-string literals as you mention, e.g. \b vs \\b
- Correct matching of parenthesises: (..[..]{..}..) with some support for
special cases such as \( or [^{]
... in general some quick and dirty checks for common mistakes and always
cheaper than parsing the regexp in pcre or Qt. For more inspiration check
StackExchange for common problems programmers have with regexps ... ;-)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to