News for hackers. Stuff that matters.
Re:Super-expressive – Write regex in natural language by TeMPOraL on Thursday January 21, 2021 @12:16PM (#25861324)
> Sadly, JavaScript does not support it. (Big mistake.)

In languages that do not support the x modifier, I just break up my regex into substrings. Something like:

  auto regex = "( \w+ )"      // Capture the name of the list
             + "\s* = \s*"    // spaces = spaces
             + ...
             + "\)";          // Closing paren
Re:Super-expressive – Write regex in natural language by sktguha on Thursday January 21, 2021 @01:23PM (#25862144)
You could perhaps use es6 templates for better readability
Re:Super-expressive – Write regex in natural language by myhf on Thursday January 21, 2021 @12:45PM (#25861674)
That's a useful technique. Thanks.