title: Ruby regex matching a string surrounded by word boundary chars when the string itself ends in a word boundary
body: <p>My regex: <code>/\b+#{string}\b+/</code> where string = 'test-'</p>
  
  <p>My test case: <code>#test-#1</code></p>
  
  <p>I want the regex to match <code>test-</code>. If my test string doesn't end in a word boundary character this works fine but if it does it breaks.</p>
  
  <p>The # chars could be any other word boundary characters also, so another example would be:</p>
  
  <p><code>-test--1</code> where I would still only want to match <code>test-</code></p>
  
  <p>Counter example case that works:</p>
  
  <p>regex: <code>/\b+#{string}\b+/</code> where string = 'test'</p>
  
  <p>test case: <code>#test#1</code></p>