ocaml-re icon indicating copy to clipboard operation
ocaml-re copied to clipboard

Suggestion: Printing the Regexes

Open Galfour opened this issue 4 years ago • 1 comments

Hello,

Currently, there are parsers for multiple syntaxes of Regex. I was wondering how complicated it would be to add printers too.

This would be quite useful for https://ligolang.org/ : we are currently writing syntax highlighter generators, and we need to produce Regex strings in a variety of contexts.

If this is not too complicated and you are open to a PR for this, we might write one.

Cheers,

Galfour avatar Jul 09 '21 09:07 Galfour

Feel free to add printers. Although note that the parsing of regular expressions does some simplifications (e.g. desugaring + into *), so whatever you print back isn't going to map 1-1 to the re you started with.

rgrinberg avatar Sep 26 '21 19:09 rgrinberg