Z
Z
Zorgios2021-09-28 22:51:52
Regular Expressions
Zorgios, 2021-09-28 22:51:52

How to leave only numbers and period in a string?

The input is a line of the form:
avs1gd6sdas2.sdas22

I leave ONLY NUMBERS with a regular expression:
/[^0-9]/
Result: 16222
But you also need to leave dots. What will the regular season look like?
Expected result: 162.22

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ikutin666, 2021-09-29
@ikutin666

everything is very simple))
/[0-9\.]/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question