Y
Y
YourKey2014-01-31 07:57:38
Regular Expressions
YourKey, 2014-01-31 07:57:38

Regular expression - how to remove extra characters?

Hello! It is not possible to compose a regular expression, there are approximately the following lines:

5.  
⊕57,371.  
623224↓57,3.  
60↑57,37209.  

You need to convert them to numbers without all the extra stuff:
5
57371
573
5737209

Those. leave only the number that comes before the point, and remove the commas. The numbers themselves are subject to change.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
TomaZ Vazovsky, 2014-01-31
@YourKey

/(\d+)?[.,]?(\d+)\./

E
Evgeny Fedorov, 2014-01-31
@JekFdrv

/([0-9]+,[0-9]+)\./
Check here

K
kompi, 2014-01-31
@kompi

Select all non-digits and replace them with ''.
regex101.com/r/aN7qT7
PS. I missed the last condition.
Then @TomaZ's option is fine.
My version:
((\d+)[,])?(\d+)[.]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question