I am trying to match String messages that doesnt starts with String Line
or line
but has the substrings TIMEKEEPER
,CLIENT
and LAW FIRM
using the below RegEx
def regEX = "^((?!(Line|line)+).).?(\\bTIMEKEEPER\\b|\\bCLIENT\\b|\\bLAW FIRM\\b|).*\$"
Below are some Sample messages.
Line 1 : Missing required fields //returns false as expected
line 2 : No Delimiter //returns false as expected
PL is not approved TIMEKEEPER //returns true as expected
CLIENT ABC is not authorized //returns true as expected
LAW FIRM address is required //returns true as expected
But the issue is, above RegEX is just matching all the messages that doesnt start with String Line
or line
only, its not checking for the matching substrings TIMEKEEPER
,CLIENT
and LAW FIRM
in the message.
ABove RegEX shouldn't match below messages but the RegEX returning true for below messages too, Can someone please help me fixing the RegEX to not to match below type of messages.
address is required //returns true instead of false
ABC is not authorized //returns true instead of false