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
Use a look-behind and a look-ahead to assert that digits must precede/follow the space(s):
(?<=\d) +(?=\d)
The entire regex matches the spaces, so no need to reference groups in your replacement, just replace with a blank.