I'm filtering out string using below regex
^(?!.*(P1 | P2)).*groupName.*$
Here group name is specific string which I replace at run time. This regex is already running fine.
I've two input strings which needs to pass through from this regex. Can't change ^(?!.*(P1 | P2))
part of regex, so would like to change regex after this part only. Its a very generic regex which is being used at so many places, so I have only place to have changes is groupName
part of regex. Is there any way where only 2
string could pass through this regex ?
1) ADMIN-P3-UI-READ-ONLY
2) ADMIN-P3-READ-ONLY
In regex groupName
is a just a variable which will be replaced at run time with required string. In this case I want 2
string to be passed, so groupName
part can be replaced with READ-ONLY
but it will pass 1
string too.
Can anyone suggest on this how to make this work ?