Tested regular expressions you can open in the tester, read the explanation of and adapt. Each pattern comes with sample text and unit tests. Save your own pattern with Save & share and tick “publish” to add it here.
6 patterns
\b(?:100(?:\.0+)?|\d{1,2}(?:\.\d+)?)%
Numbers from 0 to 100 followed by a percent sign, decimals allowed.
\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?\b
$5, $1,000, $12.99 – optional thousands separators and cents.
\B(?=(\d{3})+(?!\d))
Substitution trick: inserts a comma before every group of three digits that is followed only by more groups of three. Use the Substitution function with replacement ",".
\b\d{1,3}(?:,\d{3})*(?:\.\d+)?\b
1,234,567.89 style numbers: groups of three digits separated by commas, optional decimals.
[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?
Numbers with optional sign, decimals and exponent, like 3.14, -0.5, .5 and 6.02e23.
^[+-]?(0|[1-9]\d*)$
Whole numbers with an optional sign, no leading zeros.