Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\d+(?:,\d+)?(?: g| oz)? (.*)
/
gm
Input 1
1
New
12,2 g this is fully random 89 g random string 2 0,6 oz random stuff 1 really random stuff
Extraction
12,2 g this is fully random 89 g random string 2 0,6 oz random stuff 1 really random stuff