Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2025-10-07 02:25
Updated·2025-10-07 06:42
Flavor·Python

r"
(?P<isminus>-)? ( (?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
Open regex in editor

Description

Selects all forms of numbers, ranging from decimals, to numbers with commas

Submitted by anonymous