This Qt lib is based off of the C++ VerbalExpressions library by whackashoe.
auto expression = QVerbalExpressions()
.searchOneLine()
.startOfLine()
.then("http")
.maybe("s")
.then("://")
.maybe("www.")
.anythingBut(" ")
.endOfLine();
qDebug()
<< expression // ^(?:http)(?:s)?(?:://)(?:www.)?(?:[^ ]*)$
<< expression.test("https://www.google.com"); // true
##API
- .anything()
- .anythingBut(const QString& value)
- .something()
- .somethingBut(const QString& value)
- .endOfLine()
- .find(const QString& value)
- .maybe(const QString& value)
- .startOfLine()
- .then(const QString& value)
- .any(const QString& value)
- .anyOf(const QString& value)
- .br()
- .lineBreak()
- .range(const std::initializer_list& args)
- .tab()
- .word()
- .withAnyCase()
- .searchOneLine()
- .searchGlobal()
- .replace(const QString& source, const QString& value)
- .test()
- .add(expression)
- .multiple(const QString& value)
- .alt()