I'm trying to get with a regex using PCRE2 dialect from an HTML text all the occurrences of the word 'apple'. But excluding when the word apple it's part of a link.
I'm quite a beginner with Regex, probably I'm doing quite a simple mistake.
\bapple\b
So, the following text has to match the first occurrence but not the second and third one.
Lorem ipsum apple sit amet, consectetur <a href="#">apple</a> elit <a href="/test/apple">lorem</a>.
What am I doing wrong?