Skip to content

Instantly share code, notes, and snippets.

View simonedeponti's full-sized avatar

Simone Deponti simonedeponti

View GitHub Profile
from sre_parse import Pattern, SubPattern, parse as sre_parse
from sre_compile import compile as sre_compile
from sre_constants import BRANCH, SUBPATTERN
class Scanner(object):
def __init__(self, tokens, flags=0):
subpatterns = []
pat = Pattern()