Provide an example for the pseudo-regex: Match every url except those from example.com and example2.com according to the PHP regexp syntax.
Here is what I have so far, but it doesn’t work:
$patternToMatch = "@https?://[^(example.com|example2.com)]\"*@i";
The problem here is that within a class definition (
[]) special characters such as(and|lose their meaning.A better solution is to match on example.com or example2.com and then proceed only for negative tests.