Case insensitive search mode with QRegularExpression

Viewed 1315

This question is an expanded question of this : How to replace QRegExp in a string?

In that question, problem is solved. But now I need to use QRegularExpression instead of QRegExp. How should I transfer the answer of Toby Speight?

2 Answers

In python, it's:

re = QRegularExpression(pattern, QRegularExpression.CaseInsensitiveOption | QRegularExpression.DotMatchesEverythingOption)

And if you need 2 options

re = QRegularExpression(pattern, QRegularExpression.CaseInsensitiveOption | QRegularExpression.DotMatchesEverythingOption)

Related