-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Use QRegularExpression for find and replace (only for PyQt5) #3696
Conversation
987074c
to
67c3ee3
Compare
- This change allows the use of lazy regular expresions - Change % formating for format() in find_text function
a196def
to
c20b7f8
Compare
Nice, thanks for the quick fix @rlaverde! Could you add a test for this? |
|
||
if PYQT5: | ||
from qtpy.QtCore import QRegularExpression | ||
elif PYQT4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use else
here
if case: | ||
pattern.setPatternOptions( | ||
QRegularExpression.CaseInsensitiveOption) | ||
elif PYQT4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also use else
here :-)
Supporting this for PyQt5 if fine because we will have to eventually deprecate PyQt4 because it's not maintained anymore. |
@rlaverde, are you working on test for this one? |
LGTM, merging. Thanks @rlaverde :-) |
Partially fixes #3408 (only PyQt5)
QRegExp
didn't support lazy quantifiers, like *?, +?, etc. It's better to useQRegularExpression
.Although
QRegularExpression
is only avalaible since Qt5, so It'll continue usingQRegExp
for PyQT4