I
I
Ivan Simonov2020-05-03 19:12:12
Regular Expressions
Ivan Simonov, 2020-05-03 19:12:12

How to exclude number followed by text?

There is a text in which I am trying to find numbers.
There are no problems with this \d+:
But, if there is text after the number, we discard these numbers: \d+(?!\D).
Now these numbers are discarded, but at the same time, when finding other numbers, an error occurs (we get an incomplete number).

Example

Tell me where I make a mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-05-03
@ivan00007

\d+(?![A-Za-z])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question