Implementing Regular Expressions in TypeScript Types (Badly)
skalt.github.io
skalt.github.io
>>> re.compile(r'\w++')
re.error: multiple repeat at position 3
To use such a compiled pattern, you can call the method on this object instead of `re`. For example: >>> word = re.compile(r'\w+')
>>> word.findall('hello-there!')
['hello', 'there']https://github.com/hanickadot/compile-time-regular-expressio...
Of course, it has all the usual tradeoffs of compile-time template programming.