Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^-?\d+\.?(\d+)?([eE][+-]?\d+)?$
/
gm

Description

As 'number' is not implemented by all browsers, you can check your <input type="text" /> value with this RegExp.

Submitted by Ann MB - 3 years ago (Last modified 3 years ago)