-
Hi Phillip, I am working on a problem that requires me to get z3 regular expressions for arbitrary python I had a couple of questions:
z3re = _handle_seq(sre_parse.parse('M(?:r|s|rs)abc(?:x|y|z)'), 0)
print(z3.simplify(z3re))
Could you comment on this if my understanding is correct, and if there were any other pressing issues you faced while trying to use z3 regex primitives? Thank you so much for your time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm glad this has been helpful for you!
Other things to watch out for: Can you limit yourself to ASCII? Modern versions of z3 support unicode, but it's fairly recent and probably not super stable. I recall having some trouble with unicode over the Python bindings last year, though not the specifics. You may also run into difficulty supporting character classes like Hope this helps, and good luck on your project! |
Beta Was this translation helpful? Give feedback.
I'm glad this has been helpful for you!
flags
argument corresponds to argument of the same name that many regex functions take (e.g. re.compile(pattern, flags)). It's important because many of the flags impact how to interpret the regex.Other things to watch out for: Can you limit yourself to ASCII? Modern versions of z3 support unicode, but it's fairly recent and probably not super stable. I recall having some trouble with unicode over the Python…