title: java String split + patterns
body: <p>I'm using this method to split some text:</p>
  
  <pre><code>String[] parts = sentence.split("[,\\s\\-:\\?\\!\\«\\»\\'\\´\\`\\\"\\.\\\\\\/]");
  </code></pre>
  
  <p>Which will split me the text according to the specified symbols. One of the symbols is "-", because my text have weird things like this: "-------------- words --- words2 --words3--words4". Which will match my needs because it wont divide like this (in case i dont add "-"): "---words3---words4 (which will be considered a word in case i dont add "-").</p>
  
  <p>But there is a tricky thing. I want to allow words like this: "aaa-bbb", which is is verified by this pattern: </p>
  
  <pre><code>Pattern pattern = Pattern.compile("(?&lt;![A-Za-z-])[A-Za-z]+-[A-Za-z]+(?![A-Za-z-])");
  </code></pre>
  
  <p>allow: aaa-bb, aaa-bbbbbbb
  not allow: aaa--bb, aa--bbb-cc</p>
  
  <p>So my question is, is it possible to split my text applying the split above, but also considering this pattern is a word separator(for words like aaa-bbb) ?</p>
  
  <p>Thanks in advances,
  Richard</p>