Regex101
Regex101 copied to clipboard
(auto) indentation to make complex regexs easier to read in /x form
Feature
I'm looking at some regexes that are very complex and exhibit pathological behaviour. The first thing I wanted to do (after de-escaping, as the regex I have is a JSON string (we're playing with Elasticsearch's pattern tokenizer) was to reformulate this as an extended (/x) regular expression so I could break it down and add comments (and then unit tests; I love this tool!)
It should would be wonderful to automatically indent / reflow a regular expression. Align on comment markers for extra credit.
Thanks, Cameron
This was a feature before, but I was unable to make it work well enough with the way the expression is currently tokenized. It would be a nice feature to add (again) though.