|
|
|
|
|
by JoeCoder_
3916 days ago
|
|
Here is the TL;DR. This regex matches Tarzan but not "Tarzan": "Tarzan"|(Tarzan)
You can also include more than one case of what you don't want to match. This one also finds only the cases of Tarzan that don't match the first three patterns: Tarzania|--Tarzan--|"Tarzan"|(Tarzan)
You can even use more complex regexes. This matches all words not in an image tag: <img[^>]+>|(\w+)
And likewise this matches anything not surrounded by <b> tags: <b>[^<]*</b>|([\w\s]+)
|
|