Super-expressive – Write regex in natural language
I truly don&#x27;t see the point.<p>The code that you wind up with is so long that it is hard to read for anyone, whether or not you know regular expressions.  I&#x27;ll never remember what all of the things are called.  Anyone who knows regular expressions will find the regular expression readable.  Anyone who doesn&#x27;t is likely to find both relatively similar in effort to learn.<p>The only tool you need for maintainable regular expressions is the x modifier.  That lets you break it up with whitespace and add comments.  Here is a real example in code that I wrote for a tool used by people who don&#x27;t know regular expressions.  (This is Python that is parsing out the contents of various arrays in a bash script.)<p><pre><code>        # This match will pull those out into an array of pairs
        # representing an array name and the inside of the parens::
        #
        #  [(&#x27;sqlFiles&#x27;, &#x27; &quot;foo&quot;
        #              &quot;bar&quot;
        #              &quot;baz&quot; &#x27;), ...]
        #
        # 
        match_pairs = re.findall(
            &quot;&quot;&quot;(?xs)    # x turns on verbose expressions (allowing these comments)
                        # s says . matches everything (including newlines)
             ( \w+ )    # Capture the name of the list
             \s* = \s*  # spaces = spaces
             \(         # find open paren
               (        # Capture it.
                 (?:    # nested non-capturing pattern
                  \s+   # whitespace
                    |   # or
                  &quot;.*?&quot; # &quot; with as few characters as possible then &quot;
                 )*     # non-capturing pattern repeats 0 or more times.
               )        # end capture
             \)         # Closing paren
            &quot;&quot;&quot;, contents)
</code></pre>
If you know regular expressions, the comments are superfluous, though breaking up the expression does make it easier to read.  If you don&#x27;t know regular expressions, you should be able to figure out what the code is trying to do and how it does it.<p>How you specify that modifier varies heavily by language.  So, for example, in Perl you end your expression with &#x2F;x.  In Python you have to start your regular expression with (?x).  In Postgres you pass a third argument with &#x27;x&#x27; in it.  Sadly, JavaScript does not support it.  (Big mistake.)