Вы можете использовать [\p{P}\p{S}]
:
(\s+)|([\p{P}\p{S}])
[\p{P}\p{S}]
будет соответствовать любому символу, который является пунктуацией или символом char.
См. Список подвидов , к которым относятся эти классы:
<b>Punctuation</b>
Pc Punctuation, connector Includes "_" <a href="https://en.wikipedia.org/wiki/Underscore" rel="nofollow noreferrer">underscore</a>
Pd Punctuation, dash Includes several <a href="https://en.wikipedia.org/wiki/Hyphen" rel="nofollow noreferrer">hyphen</a> characters
Ps Punctuation, open Opening <a href="https://en.wikipedia.org/wiki/Bracket" rel="nofollow noreferrer">bracket</a> characters
Pe Punctuation, close Closing bracket characters
Pi Punctuation, initial quote Opening <a href="https://en.wikipedia.org/wiki/Quotation_mark" rel="nofollow noreferrer">quotation mark</a>. Does not include the ASCII "neutral" quotation mark. May behave like Ps or Pe depending on usage
Pf Punctuation, final quote Closing quotation mark. May behave like Ps or Pe depending on usage
Po Punctuation, other
<b>Symbol</b>
Sm Symbol, math <a href="https://en.wikipedia.org/wiki/List_of_mathematical_symbols" rel="nofollow noreferrer">Mathematical symbols</a> (e.g., +, −, =, ×, ÷, √, ∊). Does not include parentheses and brackets, which are in categories Ps and Pe. Also does not include !, *, -, or /, which despite frequent use as mathematical operators, are primarily considered to be "punctuation".
Sc Symbol, currency <a href="https://en.wikipedia.org/wiki/Currency_symbol" rel="nofollow noreferrer">Currency symbols</a>
Sk Symbol, modifier
So Symbol, other