Skip to content

Understanding Python Regular Expression Modeling using Z3 #155

Answered by pschanely
swag2198 asked this question in Q&A
Discussion options

You must be logged in to vote

I'm glad this has been helpful for you!

  1. The 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.
  2. CrossHair attempts to faithfully reproduce all the regex capabilities, but it sounds like you only need to detect whether a match exists? In that case, yes, you are much more likely to be successful using the native z3 regex capabilities.

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@swag2198
Comment options

Answer selected by swag2198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants