Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
^\d{2}$|(?<=\s)\d{2}(?=\s)|(?<=\s)\d{2}$|^\d{2}(?=\s)
"
g
Input 1
I am 21 and work at 3:30 21 abc 12:23 12345 I am 21 21 am I
Extraction
I am 21 and work at 3:30 21 abc 12:23 12345 I am 21 21 am I