Java regex program to split a string at every space and punctuation?

Posted by Ramesh Singh | Updated on

In this example, I have shared Java regex program to split a string at every space and punctuation. The regular expression "[!._,'@?//s]" matches all the punctuation marks and spaces.

Program Output


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers