Java regular expression to match _all_ whitespace characters

前端 未结 7 407
别那么骄傲
别那么骄傲 2020-12-08 02:36

I\'m looking for a regular expression in Java which matches all whitespace characters in a String. \"\\s\" matches only some, it does not match   and s

7条回答
  •  [愿得一人]
    2020-12-08 03:05

    Here's a summary I made of several competing definitions of "whitespace":

    http://spreadsheets.google.com/pub?key=pd8dAQyHbdewRsnE5x5GzKQ

    You might end up having to explicitly list the additional ones you care about that aren't matched by one of the prefab ones.

提交回复
热议问题