title: Split String end with special characters - Java
body: <p>I have a string which I want to first split by space, and then separate the words from the special characters.</p>
  
  <p>For Example, let's say the input is:</p>
  
  <pre><code>Hi, How are you???
  </code></pre>
  
  <p>I already wrote the logic to split by space here:</p>
  
  <pre><code>String input = "Hi, How are you???";
  String[] words = input.split("\\\\s+");
  </code></pre>
  
  <p>Now, I want to seperate each word from the special character.</p>
  
  <p>For example: <code>"Hi,"</code> to <code>{"Hi", ","}</code> and <code>"you???"</code> to <code>{"you", "???"}</code></p>
  
  <p>If the string does not end with any special characters, just ignore it.</p>
  
  <p>Can you please help me with the regular expression and code for this in Java?</p>