I want to do the following match:
match if
MBzzis in the string but not if[Rr][Ee][Ff]is in the string
So the following should match:
- klasdlkMBzzsdld
- MBzz
And the following should not match:
- RefmmmmMBzzmmmmm
- MBzzmmmmmmREFmmmm
etc.
For now, I am doing this terrible hack:
def mySearch(val):
if (re.compile('MBab').search(val) is not None) and \
(re.compile('[Rr][Ee][Ff]').search(val) is None):
return re.compile('MBab').search(val).group()
return None
However, I feel that for something that is as simple as this, I should be able to accomplish this as a one liner.