What should be my Regex to match fetch the WHERE condition without (GROUP\\ BY|HAVING|ORDER\\ BY|ASC|DESC|LIMIT)? It works fine if I have any of the described params. It should also work for both the cases (with or without these parameters)
I need to get id=1 or id=2
QString query = "SELECT * FROM users WHERE id=1 or id=2"
QString whereString;
QRegularExpression whereListRegex("\\ WHERE\\ (.*?)\\ (GROUP\\ BY|HAVING|ORDER\\ BY|ASC|DESC|LIMIT)\\ ", QRegularExpression::CaseInsensitiveOption);
QRegularExpressionMatch whereIterator = whereListRegex.match(query);