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
/
\W(?=\w+\W*$)
/
g
Input 1
New
This is a test string and I need to find the last occurrence of a word. This sentence will be cut short
Substitution
This is a test string and I need to find the last occurrence of a word. This sentence will be cut short