Using sed I'm trying to replace 'string' with '[[string]]' while retaining case and ignoring words with 'string' in it along with additional characters like 'strings' and those which already contain the [[]] wrapper. I'm hoping to do it with sed and the right expression, if possible.
Example:
Apple apple apples applet [[apple]]
In this example I would only want to convert 'Apple' to '[[Apple]]' and 'apple' to '[[apple]]' ignoring 'apples', 'applet' and '[[apple]]. I can substitue Apple but I lose my 'A' as it's changed to 'a.'
I'm attempting to autotag pages in my wiki so in the above example 'apples' and 'applet' don't represent existing pages and [[apple]] is already tagged.
Any ideas or has anybody been down this path before and already know I'm chasing a phantom?
Thanks