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
r"
\d+(?=\s+hp|hp)
"
gm
Input 1
1
New
1: 'Aston Martin 4.7L 8 cylinder 420 hp 346 ft-lbs', 2: 'Dodge 5.7L 8 Cylinder 390hp 407 ft-lbs', 3: 'MINI 1.6L 4 Cylinder 118 hp 114 ft-lbs', 4: 'Ford 5.0L 8 Cylinder 360hp 380 ft-lbs FFV', 5: 'GMC 6.0L 8 Cylinder 352 hp 382 ft-lbs'},
Substitution
1: 'Aston Martin 4.7L 8 cylinder 420 hp 346 ft-lbs', 2: 'Dodge 5.7L 8 Cylinder 390hp 407 ft-lbs', 3: 'MINI 1.6L 4 Cylinder 118 hp 114 ft-lbs', 4: 'Ford 5.0L 8 Cylinder 360hp 380 ft-lbs FFV', 5: 'GMC 6.0L 8 Cylinder 352 hp 382 ft-lbs'},