title: Java (Regex) - Get all words in a sentence
body: <p>I need to split a java string into an array of words.  Let's say the string is:</p>
  
  <pre><code>"Hi!! I need to split this string, into a serie's of words?!"
  </code></pre>
  
  <p>At the moment I'm tried using this <code>String[] strs = str.split("(?!\\w)")</code> however it keeps symbols such as ! in the array and it also keeps strings like "Hi!" in the array as well.  The string I am splitting will always be lowercase.  What I would like is for an array to be produced that looks like:
  <code>{"hi", "i", "need", "to", "split", "this", "string", "into", "a", "serie's", "of", "words"}</code> - Note the apostrophe is kept.</p>
  
  <p>How could I change my regex to not include the symbols in the array?</p>
  
  <p>Apologies, I would define a word as a sequence of alphanumeric characters only but with the ' character inclusive if it is in the above context such as "it's", not if it is used to a quote a word such as "'its'".  Also, in this context "hi," or "hi-person" are not words but "hi" and "person" are.  I hope that clarifies the question.</p>