Regex match a word not followed by two other words
问题 I have some links: utmcsr=rdstation|utmccn=curso-intro-coaching|utmcmd=inbound|utmctr=link3 utmcsr=rdstation|utmccn=agenda-psc|utmcmd=email utmcsr=rdstation|utmccn=pnl-porto-alegre I want to build a regex expression that matches the rdstation not followed by inbound OR email . I've tried rdstation(?!(email|inbound)) but it doesn't worked. 回答1: The problem is that your negative lookahead is anchored to the position directly after rdstation. It would only exclude strings like this: