Regular Expressions 101

Community Patterns

Floating point number with optional positive/negative

0

Regular Expression
PCRE2 (PHP >=7.3)

/
[+-]?[0-9]*\.?[0-9]+
/
gm

Description

Basic matches an integer or floating point number with optional positive or negative signed.

Submitted by Tony Le - 3 years ago