Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
number selector, with commas & decimals
Open Workspace
PCRE2 (PHP)
Match
Created 2026-02-12 05:04
1
Regular Expression
/
(?P<isminus>
-
)?
(?P<number>
(?P<justdecimal>
(?P<justdecpoint>
\.
)
(?P<justdecdigits>
\d
+
)
)
|
(?P<integer>
(?P<withcommas>
(?:
\d
{1,3}
)
(?:
,
\d
{3}
)+
)
|
(?P<nocommas>
\d
+
)
)
(?P<decimal>
(?P<decpoint>
\.
)
(?P<decdigits>
\d
+
)
)?
)
/
gmx
Description
selects numbers, with commas and decimals, like 1,234.56
Submitted by
Bicorn