wrapclib wrapclib is a wrapper for some C libraries difficult to build otherwise. One if them is re2 with some taken from pyre2. from wrapclib import re2 s = "<h1>mot</h1>" print(re2.compile("(<.*>)").match(s).groups()) Links: GitHub/wrapclib documentation Blog