Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^\d+(?:\.+\d*)?$
/

Description

This regex checks for numbers with optional decimal part.

Submitted by Pratik Sanyal - 8 years ago