Regular Expressions 101

Community Patterns

1...34567...293

Regex for real number

2

Regular Expression
ECMAScript (JavaScript)

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

Description

this regex can detect any real number whether it is signed or unsigned.plus it can detect real number both with and without floating point aka '.'.the numbers should be decimal number

Submitted by Adnan nabib - 3 years ago