J
J
jforjuly2016-10-20 15:43:08
Programming
jforjuly, 2016-10-20 15:43:08

What is the regular expression for a sentence with two digit numbers?

I'm trying to find a regular expression for sentences with two-digit numbers (if there are 3 or more characters in the number, it doesn't work). Tried to use

[^0-9]*[0-9][0-9][^0-9]*

but it returns true when the phrase "I have 100 rubles"
I use c#

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
iBird Rose, 2016-10-20
@iiiBird

/(^|\s)\d{2}?(\s|$)/

D
display: block, 2016-10-20
@qork

^[^\d]+?\d{2}[^\d]+$

K
Kovalsky, 2016-10-20
@lazalu68

\b\d{1,2}\b

Q
qwertyqwerty, 2016-12-04
@qwertyqwerty

uniq -u uniq.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question