I need to replace blocks of text between a couple of markers.
Sample text :
"some text here [comment:# Variable text] and some more text here"
I would like to replace "[comment:# Variable text]" with nothing.
Note: 'Variable text' will be be different throught the text.
I am imagining an SQL function that might accept wild cards perhaps like this:
SET MyText = dbo.fn_WildReplace(MyText ,'[comment:#%]','')
[Edit: amended sytax]
In my case the opening and closong brackets will be in the text, and are not meant to represent any wild card expression format.
I was wondering if anyone had come across/coded a sulution to such a challenge ..?
Or perhaps you have an easier solution ..?
Here is a larger test text:
Without a doubt SQLCentral is home to finest SQL folk[comment:#grovel].
Sometimes things may get heated[comment:#super hot debate].
But great minds find their way[comment:#method to madness?].
The rest of us eat Pork Chops[comment:#ha ha
Should end up as :
Without a doubt SQLCentral is home to finest SQL folk.
Sometimes things may get heated.
But great minds find their way.
The rest of us eat Pork Chops.
Excel Database Tasks : efficient business data processing
Version 3.3 released February 2015