Re:Learn RegEx step by step, from zero to advanced
by jhgb on Wednesday November 17, 2021 @03:21PM
(#29258344)
> Ignoring the flame bait, for me the only things I wish more regex engines supported (cough JavaScript) is the ability to ignore whitespace, and have named groups.
Irregex? http://synthcode.com/scheme/irregex/
Re:Learn RegEx step by step, from zero to advanced
by cdrini on Saturday November 20, 2021 @04:52PM
(#29292176)
Interesting! I don't think that's what I mean. I don't think I want it to be a part of the language like that, but that's a pretty neat idea. For example, python has an 'X' flag you can use when creating a regex to allow new lines and comments. Here's an example from my code: https://github.com/internetarchive/openlibrary/blob/1ac15a48...
In general I would say ~70% of regexes are highly readable. With tools like the above, you can probably go to like ~85%? There are some regexes that are super complicated and then likely should be refactored into a composition of simpler regexes. But that's just a guess. I wonder if there are any studies done about this...