Regex101 icon indicating copy to clipboard operation
Regex101 copied to clipboard

(auto) indentation to make complex regexs easier to read in /x form

Open cameronkerrnz opened this issue 5 years ago • 1 comments

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

cameronkerrnz avatar Feb 05 '20 01:02 cameronkerrnz

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.

firasdib avatar Mar 08 '20 10:03 firasdib