Regular Expressions 101

Community Patterns

1...45678...284

Matches everything but digits and allows for one decimal point.

0

Regular Expression
ECMAScript (JavaScript)

/
[^\d.]+|(\.\d.\.).+|(\..*)\.
/
gm

Description

Matches everything but digits and allows for one decimal point.

  • cannot start with a negative

Allowed: 123 1.0 .123 0.123

Not allowed: .123.123 -1 .-123

Submitted by Random Guy 70hz - 2 years ago