4
4
4upik2017-10-18 13:55:49
Regular Expressions
4upik, 2017-10-18 13:55:49

How to remove spaces between digits in regular expressions?

there is data of the form
different text 10 000 different text
different text 15 000 different text
different text 200 000 different text
how to make the space only between numbers removed and become in this format
different text 10000 different text
different text 15000 different text
different text 200000 different text
tried delete through \d\s\d
but three characters are deleted, a digit, a space and a digit, and I need to find exactly the spaces only between the digits, is it possible to select somehow to search for \d\s\d but delete only \s
such an option to find (\d )(\s)(\d) substitution \1\3 didn't work either, because in the software used can only find and delete immediately. and if you insert \1\3, then it is inserted as plain text

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
display: block, 2017-10-18
@qork

/(\d)(?= \d) /g
https://regex101.com/r/mC06UE/1

A
Alexander, 2017-10-18
@zkelo

Here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question