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
/
^(AllowUsers )(?>(.*)?(\bbob\b)(.*)|(.*))$
/
gm
Input 1
New
AllowUsers richard AllowUsers richard jeremy AllowUsers james richard jeremy AllowUsers jeremy AllowUsers bob AllowUsers bob billybob AllowUsers billybob bob AllowUsers billybob steve bob eric bobby AllowUsers billybob bobby steve bob eric AllowUsers richard bob AllowUsers richard bob jeremy AllowUsers bob james richard jeremy AllowUsers bob jeremy abc
Extraction
AllowUsers richard AllowUsers richard jeremy AllowUsers james richard jeremy AllowUsers jeremy AllowUsers bob AllowUsers bob billybob AllowUsers billybob bob AllowUsers billybob steve bob eric bobby AllowUsers billybob bobby steve bob eric AllowUsers richard bob AllowUsers richard bob jeremy AllowUsers bob james richard jeremy AllowUsers bob jeremy abc