I'm a newbie here and would like to write a regex in Python to return True if the search keyword is found and it's NOT preceded by specific character/s.
Basically, would like to return True if it does NOT contain "--" anywhere before the specific search keyword since "--" denote comment in SQL syntax.
Ex:
s1 = "from tblEmployee e"
s2 = "--from tblEmployee e"
s3 = "from tblDepartment --tblEmployee e"
s4 = "from tblEmployee e --sample comment"
Given the scenario above if we're looking for "tbl_Employee" keyword, it will only return True for s1 and s4.
Is it possible?
Any suggestion would be appreciated.
Thanks!
Edit: Searching keyword should be exact match including the casing:
Ex:
s5 = "from tblEmployee1 e"
s6 = "from tblEmployee1"
s7 = "from TBLEmployee e"
s5, s6 and s7 will return False.