0

I see from this question that there's a re.++ function in the SMTLIB bindings that seems to do what I want. What is its equivalent in the Python bindings? For example:

from z3 import *
r1 = Star(Re('ab'))
r2 = Re('a')
r_concatenated = Re(r1 ++ r2)

which would be equivalent to the regex ab*a. How do I get r_concatenated?

ahelwer
  • 1,441
  • 13
  • 29

1 Answers1

0

I found the answer about one minute after posting this question. If you use the Concat method it works, although the documentation only mentions bitvectors. So the code would be:

from z3 import *
r1 = Star(Re('ab'))
r2 = Re('a')
r_concatenated = Concat(r1, r2)
ahelwer
  • 1,441
  • 13
  • 29
  • 1
    Duplicate of https://stackoverflow.com/questions/64408788/how-to-concatenate-regular-expressions-in-z3py – alias Nov 03 '21 at 22:15