3 ms·
Most regexp libraries let you use named groups and comments which let you write more maintainable expressions. The fact javascript does not may explain why so m
by arkh 8y ago
Most regexp libraries let you use named groups and comments which let you write more maintainable expressions. The fact javascript does not may explain why so many people don't know how to use them.
https://www.regular-expressions.info/freespacing.html https://www.regular-expressions.info/freespacing.html
https://www.regular-expressions.info/named.html https://www.regular-expressions.info/named.html
- gmac 8y agoYou can have some of this in JS too by using libraries such as this one (which is mine): https://github.com/jawj/js-xre https://github.com/jawj/js-xre
- tlarkworthy 8y agoIt does now! (named capture groups)
- chrissam 8y agoES2018 introduces named capture groups. They're available today in Chrome, unsure about other browsers.