Given a text string (a markdown document) I need to achieve one of this two options:
to replace all the matches of a particular expression (
(\W)(theWord)(\W)
) all across the document EXCEPT the matches that are inside a markdown image syntax
.to replace all the matches of a particular expression (
{{([^}}]+)}}\[\[[^\]\]]+\]\]
) ONLY inside the markdown images, ie.:![Blah {{theWord}}[[1234]] blah](url)
.
Both expressions are currently matching everything, no matter if inside the markdown image syntax or not, and I've already tried everything I could think.
Here is an example of the first option
And here is an example of the second option
Any help and/or clue will be highly appreciated.
Thanks in advance!