title: Regular expression to match any word followed by a literal string
body: <p>So I have the following:</p>
  
  <pre><code>^[a-zA-Z]+\b(myword+-)\b*
  </code></pre>
  
  <p>which I thought would match </p>
  
  <ul>
  <li><code>^</code> start of string</li>
  <li><code>[a-zA-Z]</code> any alpha character</li>
  <li><code>+</code> of one or more characters</li>
  <li><code>\b</code> followed by a word break</li>
  <li><code>(myword+-)</code> followed by myword which could include one or more special characters</li>
  <li><code>\b</code> followed by a word break</li>
  <li><code>\*</code> followed by anything at all</li>
  </ul>
  
  <p>One: it does not work - it does not match anything</p>
  
  <p>Two: any special characters included in <code>{myword+-)</code> throws an error</p>
  
  <p>I could escape the special characters, but I don't know in advance what they might be, so I would have to escape all the possibilites, or perhaps I could just escape every character in <code>{\m\y\w\o\r\d\\+\\-)</code></p>
  
  <p><em>Edited to add:</em></p>
  
  <p>Sorry, I knew I should have given more information</p>
  
  <p>I have a series of strings to seach through in the form:</p>
  
  <p>extra android-sdk and more that is of no interest<br>
  extra android-ndk and more that is of no interest<br>
  extra anjuta-extra and more that is of no interest<br>
  community c++-gtk-utils and more that is of no interest  </p>
  
  <p>and I have a list of items to search for in the strings:</p>
  
  <p>android-sdk<br>
  android-ndk<br>
  extra<br>
  c++-gtk-utils  </p>
  
  <p>The item should only match if the second word in the string is an exact match to the item, so:</p>
  
  <p>android-sdk will match the first string<br>
  android-ndk will match the second string<br>
  extra wuill NOT match the third string<br>
  c++-gtk-utils will match the fourth string  </p>
  
  <p>So (myword+-) is the item I am searching for "which could include one or more special characters"</p>
  
  <p>Thanks for the help</p>
  
  <p>Andrew</p>