P
P
petrov_ruslan2020-02-27 01:01:58
JavaScript
petrov_ruslan, 2020-02-27 01:01:58

How to get the area value from a string?

There is a line 1-room apartment, 39 m², 1/5 floor. , I want to keep only 39. I can't think of an expression.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladimir Proskurin, 2019-07-07
@xamelion1

No way. This is a window for HTTP authorization, such a window cannot be displayed or processed through JS. It pops up when the server returns an HTTP 401 code and a WWW-Authenticate header.

0
0xD34F, 2020-02-27
@petrov_ruslan

re.findall(r'\d+(?:\.\d+)?(?= м²)', s)

N
nokimaro, 2020-02-27
@nokimaro

https://regex101.com/r/FVHvlc/1

M
Michael Aniskin, 2020-03-06
@MichaelAniskin

/\d{1,3}(?=\s\W+,)/
But a lot depends on which lines it will be drawn from.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question