7 patterns
Numbers Regex Patterns
Numeric validation patterns covering the full range of number formats used in forms and data processing. From simple integers to complex scientific notation.
Common Use Cases
All Numbers Patterns
Positive Integer
Positive integer or zero only.
^[0-9]+$Signed Integer
Integer with optional sign (+ or -).
^[+-]?[0-9]+$Percentage 0-100
Percentage from 0 to 100% with optional symbol.
^100(?:\.0+)?%?$|^\d{1,2}(?:\.\d+)?%?$Positive Float
Validates a positive decimal number (e.g. 3.14, 0.5).
^\d+\.\d+$Scientific Notation
Validates numbers in scientific notation (e.g. 1.5e10, -3E-4).
^-?\d+(\.\d+)?[eE][+-]?\d+$Number with Thousands Separator
Validates US-style numbers with comma thousands separator (1,234,567.89).
^-?\d{1,3}(,\d{3})*(\.\d+)?$Roman Numeral
Validates Roman numerals (I to MMMM, i.e. 1-4000).
^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$Frequently Asked Questions
How do I validate a decimal number?
^-?\d+(\.\d+)?$ - allows optional negative sign and optional decimal part.
How do I validate a percentage?
^(100|[0-9]{1,2})(\.[0-9]+)?%?$ - matches 0 to 100 with optional decimal and percent sign.
How do I validate that a field contains only digits?
^\d+$ - matches one or more digits, no spaces or signs.
Looking for patterns in other categories?
Browse all 209 patterns