Regular Expressions 101

Community Patterns

get number and unit in string

1

Regular Expression
ECMAScript (JavaScript)

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

Description

match int or float number, and following word (unit for example)

Submitted by Etienne Goumet - 9 years ago