Regular Expression: Any character that is NOT a letter or number

前端 未结 9 864
花落未央
花落未央 2020-12-07 19:32

I\'m trying to figure out the regular expression that will match any character that is not a letter or a number. So characters such as (,,@,£,() etc ...

Once found I

9条回答
  •  天命终不由人
    2020-12-07 20:22

    Just for others to see:

    someString.replaceAll("([^\\p{L}\\p{N}])", " ");
    

    will remove any non-letter and non-number unicode characters.

    Source

提交回复
热议问题