Regular Expressions 101

Community Patterns

1...56789...877

unit selector regex

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(g|l|m|k)\w*
/
gm

Description

This regex can be used to select SI units of gallon, litres, kilograms, kilometres, pounds.

Submitted by anonymous - a year ago