I'm really sad that Perl didn't solve the issue of regex readability before regex popularity exploded across every other programming language. Unreadable regular expressions have become a cross-cultural norm. Unfortunately Perl 6, which will have the extended whitespace feature enabled by default, will be released two years too late.
Fortunately for the brave few willing to break with tradition, you can easily add white space to your regular expressions. Every programmer alive already adds whitespace to every other programming language. I doubt anyone finds the regular expression syntax so verbose and readable that whitespace has become obsolete.
Here's how you add whitespace to various languages:
Perl: m/pattern/x
java.util.regex: Pattern.COMMENTS or the x modifier
.NET: IgnorePatternWhitespace or the x modifier
Python: X or VERBOSE
PHP: /pattern/x
Javascript: Doesn't support it but who cares. You can get around it with this:
var phone regex =
"\\d\\d\\d" // area code
+ "\\d\\d\\d-" // prefix
+ "\\d\\d\\d"; // exchange
I've got more to say about the importance of whitespace in my article, Five Habits for Successful Regular Expressions and in some slides from my talk Regular Expression Best Practices.