Regular Expressions 101

Community Patterns

<input type="number" /> pattern

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 - 2 years ago (Last modified 2 years ago)