Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
[-]?[0-9]+[,.]?[0-9]*([\/][0-9]+[,.]?[0-9]*)*
/
gm

Description

Matches integer numbers, floats and fractions of floats. I.e. "2", "-3.456", "3/4", "2.1/8".

Submitted by anonymous - 5 years ago