title: Split Ruby regex over multiple lines
body: <p>This might not be quite the question you're expecting! I don't want a regex that will match over line-breaks; instead, I want to write a long regex that, for readability, I'd like to split onto multiple lines of code. </p>
  
  <p>Something like:</p>
  
  <pre><code>"bar" =~ /(foo|
             bar)/  # Doesn't work!
  # =&gt; nil. Would like =&gt; 0
  </code></pre>
  
  <p>Can it be done?</p>