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
/
^(?!.*\/s\/123)(?!.*\/s\/32A )(?!.*atr\/will)([\/a-zA-Z]*)\/_MyWord\/(.*)$
/
gm
Input 1
1
New
/s/123/QWERERTYU/_MyWord/45454545 atr/will/DFGH/FGHJK/GHJK/_MyWord/DFGHJ452 /DFGH/FGHJK/GHJK/_MyWord/DFGHJ452 HiCanYouHelpMe/_MyWord/fgh /_MyWord/HiCanYouHelpMefgh I am handling user input in my program by using regular exp. the string contains /_MyWord/ and only a-z is accepted before /_MyWord/. the string not contain /s/123, /s/32A and atr/will in the beginning. My try: ^(?!.*/s/123)(?!.*/s/32A )(?!.*atr/will)([/a-z]+)/_MyWord/(.*)$ Example: /s/123/QWERERTYU/_MyWord/45454545 -> fail /DFGH/FGHJK/GHJK/_MyWord/DFGHJ452 -> OK HiCanYouHelpMe/_MyWord/fgh -> OK /_MyWord/HiCanYouHelpMefgh -> OK