Warning, /sdk/clazy/docs/checks/README-use-static-qregularexpression.md is written in an unsupported language. File is not indexed.
0001 # use-static-qregularexpression
0002
0003 Finds places such as
0004
0005 ```cpp
0006 QString str = ...;
0007 if (str.contains(QRegularExpression(...))) { ... }
0008
0009 QRegularExpression re(...);
0010 if (str.indexOf(re, 0)) { ... }
0011 ```
0012
0013 and suggests to use a `static` QRegularExpression object instead to avoid recreating the regular expressions.
0014
0015 Note that it only checks for functions using `QRegularExpression` from `QString` and `QStringList`.