Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
>(occurence(?:\s(?:[\w']+),?){0,100})|((?:\s(?:[\w']+)){0,100}\s?occurence(?:\s(?:[\w']+),?){0,100})|((?:\s(?:[\w',]+)){0,100}\s?occurence)<
/
Input 1
1
New
<p>Do not forget the error handling, I don't exactly know what happens if it wants to replace an occurence and can't find it</p> <p>Edit: If you have multiple entries which should be replaced, loop the replace part until it will not be able to replace anymore then it will throw an error you can catch to continue</p>
Extraction