Regular Expressions 101

Community Patterns

Number

-3

Regular Expression
ECMAScript (JavaScript)

/
-?\d+\.?\d*
/
g

Description

Gets all numbers in a string. This includes positive and negative numbers aswell as integers and floats.

By: http://www.benlorantfy.com/

Submitted by Ben - 10 years ago