title: Ruby/Regex Error: warning: character class has duplicated range
body: <p>Im trying to get this <a href="http://www.arachnoid.com/ruby/rubyBeautifier.html" rel="noreferrer">Ruby code beautifier</a> working and have hit on a problem to do with regular expressions that to be honest I just don't understand as my experience with them is extremely limited.</p>
  
  <p>The error that Im getting is:</p>
  
  <pre><code>warning: character class has duplicated range: /.*=\s*&lt;&lt;-?\s*([_|\w]+).*/
  </code></pre>
  
  <p>Which points to this line:</p>
  
  <pre><code>here_doc_term = tline.sub(%r{.*=\s*&lt;&lt;-?\s*([_|\w]+).*},"\\1")
  </code></pre>
  
  <p>Could someone please be kind enough to point out what the issue is with this expression?</p>
  
  <p>Thanks.</p>