19 @param options list of options (list of string) |
19 @param options list of options (list of string) |
20 @return tuple of flag indicating validity (boolean), error |
20 @return tuple of flag indicating validity (boolean), error |
21 string (string) and error offset (integer) |
21 string (string) and error offset (integer) |
22 """ |
22 """ |
23 try: |
23 try: |
24 from PyQt5.QtCore import QRegularExpression |
24 from PyQt6.QtCore import QRegularExpression |
25 rxOptions = QRegularExpression.PatternOption.NoPatternOption |
25 rxOptions = QRegularExpression.PatternOption.NoPatternOption |
26 if "CaseInsensitiveOption" in options: |
26 if "CaseInsensitiveOption" in options: |
27 rxOptions |= QRegularExpression.PatternOption.CaseInsensitiveOption |
27 rxOptions |= QRegularExpression.PatternOption.CaseInsensitiveOption |
28 if "MultilineOption" in options: |
28 if "MultilineOption" in options: |
29 rxOptions |= QRegularExpression.PatternOption.MultilineOption |
29 rxOptions |= QRegularExpression.PatternOption.MultilineOption |
76 """ |
76 """ |
77 valid, error, errorOffset = rxValidate(regexp, options) |
77 valid, error, errorOffset = rxValidate(regexp, options) |
78 if not valid: |
78 if not valid: |
79 return valid, error, errorOffset |
79 return valid, error, errorOffset |
80 |
80 |
81 from PyQt5.QtCore import QRegularExpression |
81 from PyQt6.QtCore import QRegularExpression |
82 rxOptions = QRegularExpression.PatternOption.NoPatternOption |
82 rxOptions = QRegularExpression.PatternOption.NoPatternOption |
83 if "CaseInsensitiveOption" in options: |
83 if "CaseInsensitiveOption" in options: |
84 rxOptions |= QRegularExpression.PatternOption.CaseInsensitiveOption |
84 rxOptions |= QRegularExpression.PatternOption.CaseInsensitiveOption |
85 if "MultilineOption" in options: |
85 if "MultilineOption" in options: |
86 rxOptions |= QRegularExpression.PatternOption.MultilineOption |
86 rxOptions |= QRegularExpression.PatternOption.MultilineOption |