title: Can I combine these 3 rewrite rules into 1?
body: <p>I'm having a brain fade and need some help please. I'm using 3 RewriteRules to accomplish something that I think should take just one:</p>
  
  <pre><code>RewriteRule ^([0-9]+)$ /bar/$1.html [R=301,L]
  RewriteRule ^([0-9]+)(-*)$ /bar/$1.html [R=301,L]
  RewriteRule ^([0-9]+)-([0-9]+)$ /bar/$1.html#$2 [R=301,NE,L]
  </code></pre>
  
  <p>I need to take the following URLs:</p>
  
  <pre><code>http://foo.com/100
  http://foo.com/100-1
  http://foo.com/200-
  http://foo.com/1999
  http://foo.com/1999-99
  </code></pre>
  
  <p>...and rewrite them like this:</p>
  
  <pre><code>http://foo.com/bar/100.html
  http://foo.com/bar/100.html#1
  http://foo.com/bar/200.html
  http://foo.com/bar/1999.html
  http://foo.com/bar/1999.html#99
  </code></pre>
  
  <p>What I have <em>works</em> but seems like a bit of a hack. is there a way to combine this all in to one rule?</p>