Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^-?(\d|(\d+,?\d+))*(\.\d+)?(e\d+)?$
/

Description

Matches numbers in most forms - normal, decimal, exponential, comma separted

Submitted by Shashwat Black - 9 years ago