Fixing Negative Assertion for end of string
问题 I am trying to accept a capture group only if the pattern matches and there is not a specific word before the end of the group. I've tried a # of approaches and none seem to work, clearly I'm not getting the concept: https://regex101.com/r/iP2xY0/3 https://regex101.com/r/iP2xY0/4 Regardless of what I do my capture group captures something and my goal is if the reject word exists in the middle of the pattern to return no match. RC:\*.*?(?P<Capture>(Bob|David|Ted|Alice))(?!Reject).* RC:* Hi Bob