title: How to use split() to remove all delimiters from a sentence in Java?
body: <pre><code>String text = "Good morning. Have a good class. " +
  "Have a good visit. Have fun!";
  String[] words = text.split("[ \n\t\r.,;:!?(){");
  </code></pre>
  
  <p>This <code>split</code> method is provided in text book, meant to remove all the delimiters in the sentence as well as white space character but clearly it is not working and throws a regex exception to my disappointment....I am wondering what could we do here to make it work? The requirement is after the <code>split</code> method, everything in the `String[] words are either just English words without any delimiters attaching to it or whitespace character! Thanks a lot!</p>