Regular Expressions 101

Community Patterns

Community Library Entry

4

Regular Expression
PCRE (PHP <7.3)

/
\b([\d\.]+)[mkb%](?!\S)
/
ig

Description

Usage: "40%".replace(/\b([\d.]+)mkb%/ig, '$1')

Submitted by anonymous - 9 years ago