I want to do a match for a string when no abc is followed by some characters (possibly none) and ends with .com.
I tried with the following
Do you just want to exclude strings that start with abc? That is, would xyzabc.com be okay? If so, this regex should work:
^(?!abc).+\.com$
If you want to make sure abc doesn't appear anywhere, use this:
^(?:(?!abc).)+\.com$
In the first regex, the lookahead is applied only once, at the beginning of the string. In the second regex the lookahead is applied each time the . is about to match a character, ensuring that the character is not the beginning of an abc sequence.