REGEX Remove Space

前端 未结 5 1440
我寻月下人不归
我寻月下人不归 2020-12-20 07:44

I want to creating regex to remove some matching string, the string is phone number

Example user input phone number like this:

+jfalkjfkl saj f62 81 78

5条回答
  •  甜味超标
    2020-12-20 07:54

    I don't know what language you plan on using this in, but you can replace this pattern: [^\d]+, with an empty string should accomplish this. It'll remove everything that's not a number.

提交回复
热议问题