Regular Expressions 101

Community Patterns

Get value from string

1

Regular Expression
ECMAScript (JavaScript)

/
.*[a-z\-0-9]+\-([0-9]+).*
/

Description

Used to get a value from a class e.g.: [...] class="font-12"[...] This regEx will receive "12" given the content of the class

Submitted by Gabriel R. Sezefredo - 9 years ago