What would the QRegExp pattern be for capturing single quoted text for QSyntaxHighlighter? The matches should include the quotes, because I am building a sql code editor.
Test Pattern
string1 = 'test' and string2 = 'ajsijd'
So far I have tried:
QRegExp("\'.*\'")
I got it working on this regex tester: https://regex101.com/r/eq7G1v/2 but when I try to use that regex in python its not working probably because I need to escape a character?
self.highlightingRules.append((QRegExp("(['])(?:(?=(\\?))\2.)*?\1"), quotationFormat))
I am using Python 3.6 and PyQt5.