Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
Created·2024-10-08 14:04
Flavor·PCRE2 (PHP)

/
^[-+]?(\d+[,.]|\d*[.,]?\d+)(e[-+]?\d+)?$
/
i
Open regex in editor

Description

Check if a floating point number (e.g. 3.14159) is in a valid format.

Submitted by anonymous