Regular Expressions on Punctuation

I would try a character class regex similar to

"[.!?\\-]"

Add whatever characters you wish to match inside the []s. Be careful to escape any characters that might have a special meaning to the regex parser.

You then have to iterate through the matches by using Matcher.find() until it returns false.

Leave a Comment