Both myself and @pschanely (somewhat) independently implemented the same function converting Python regexes to Z3 regexes using the output of python's sre_parse module. Here is my implementation and here is Phillip's. Given the obvious utility of allowing users to express regexes in a simple, familiar & well-specified syntax, should this function be added to the Z3 Python API? I would be happy to make the necessary changes.