I have this Regex expression.
^BRN.*?(?:paid|to)\s([A-Za-z\s]+)\b(?<!\bself)
I want to it return the words after the required pattern, but only is certain words are not found. If they are found, then the Regex shouldn't return anything. Thus,
BRN CLG-CI IQ PAID IONANDA PAUL
should return IONANDA PAUL, which it does. So it's correct there. But I want
BRN-TO CASH SELF
to return a null string or essentially it matches but returns no output. Currently, the regex returns this CASH\s, the \s means a whitespace is included in the output. I tried negative lookbehind but I am still looking for how to just not return anything, if the word is found. Thanks!