Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<!\[|\{|\(|#)(\b\d+\b)(?!\]|\}|\|st|nd|rd|th)
/
gm
Input 1
1
New
123abd //should match 123 abc345 //should match 234 ab2123cd // should match 2123 {2}: Should NOT Match. //My regex Works {34: Should NOT Match. //My regex matches 4 in {34 45}: Should NOT Match. //My regex matches 4 in {45 {123}: Should NOT Match. //My regex matches 2 in {123} 1st should NOT match 3th should NOT match, since it's wrong anyway 1nd should NOT match, since it's wrong anyway 14th //should NOT Match 14 th should Match