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
/
(?<=by )(\w+ \w+)(?:,\s*)?(\w+ \w+)?(?:\sand\s)?(\w+ \w+)?
/
gmi
Input 1
New
By Person One, Person Two and Person Three By Person One, Person Two By Person One By Person Two and Person Three
Substitution
By Person One, Person Two and Person Three By Person One, Person Two By Person One By Person Two and Person Three