title: Match word in String in Java
body: <p>I'm trying to match Strings that contain the word <code>"#SP"</code> (sans quotes, case insensitive) in Java. However, I'm finding using Regexes very difficult!</p>
  
  <p>Strings I need to match:
  <code>"This is a sample #sp string"</code>, 
  <code>"#SP string text..."</code>, 
  <code>"String text #Sp"</code></p>
  
  <p>Strings I do not want to match: 
  <code>"Anything with #Spider"</code>,
  <code>"#Spin #Spoon #SPORK"</code></p>
  
  <p>Here's what I have so far: <a href="http://ideone.com/B7hHkR" rel="nofollow">http://ideone.com/B7hHkR</a> .Could someone guide me through building my regexp?</p>
  
  <p>I've also tried: <code>"\\w*\\s*#sp\\w*\\s*"</code> to no avail.</p>
  
  <p>Edit: Here's the code from IDEone:</p>
  
  <pre><code>java.util.regex.Pattern p = 
      java.util.regex.Pattern.compile("\\b#SP\\b", 
          java.util.regex.Pattern.CASE_INSENSITIVE);
  
  java.util.regex.Matcher m = p.matcher("s #SP s");
  
  if (m.find()) {
      System.out.println("Match!");
  }
  </code></pre>