Regular Expressions 101

Community Library

Community Library Entry

6

Regular ExpressionOpen Workspace

/
^[\-]{0,1}[0-9]+[\.][0-9]+|[\-]{0,1}[0-9]+$
/
g

Description
Created·2015-10-20 16:06
Type·Match
Flavor·JavaScript

Verifies Number is a negative/positive number. Number may be a decimal, but if it is, it requires at least one number before and after the decimal place. Decimal numbers may also be negative or positive. Only 1 decimal place is allowed.

Submitted by David P Smith
Open Workspace