title: Is there a Python equivalent to the Perl "/x" modifier for regular expressions?
body: <p>Perl makes it easy to construct <a href="https://softwareengineering.stackexchange.com/a/194999/24321">readable regular expressions</a> using the <code>/x</code> modifier. This modifier allows to write regular expression strings and ignore all whitespaces in these strings. In other words, logical parts of the regular expression can be separated by whitespace or even carriage returns, allowing great readability. In Python, the only way I see of doing this is to construct such regular expression string, remove whitespace from it in an intermediate step, and then use the resulting string for matching. Is there a more elegant way of doing this?</p>