Microsoft Content Management Server - Global Search and Replace Special case

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2007 > Global Search and Replace Special case





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Global Search and Replace Special case
maheshvd@gmail.com

2007-02-09, 7:17 pm

Hi All,

I've created a routine which iterates through all placeholders of a
posting to find and replace strings. This works well when the search
string is a one word string. It fails when I've HTML tags embeded in
between. There are thousands of postings. The users have created all
sorts of HTML around the content, and now there is a requirement to
update strings which contain HTML. I'm doing this using regex.replace
method. But I cannot ask users to enter all combinations of HTML
around the search string. Somehow I need to ignore HTML tags between
the searched strings while replacing within the placeholder content.
Is there any other way I can achieve this?
e.g.
User wants to update reference of "This is <b>test</b>" from all
postings to "This is an updated test". So either I find a regular
expression which ignores all HTML tags in between search string, or
use any other mechanism which does this for me.

Appreciates any thoughts on this.

Regards,
Mahesh

Stefan Goßner [MSFT]

2007-02-12, 7:18 am

Hi Mahesh,

this is not a MCMS related question but a Html/DOM related question.
Please post your question to an Html related newsgroup.

Cheers,
Stefan

<maheshvd@gmail.com> wrote in message
news:1171064265.359325.221280@v45g2000cwv.googlegroups.com...
> Hi All,
>
> I've created a routine which iterates through all placeholders of a
> posting to find and replace strings. This works well when the search
> string is a one word string. It fails when I've HTML tags embeded in
> between. There are thousands of postings. The users have created all
> sorts of HTML around the content, and now there is a requirement to
> update strings which contain HTML. I'm doing this using regex.replace
> method. But I cannot ask users to enter all combinations of HTML
> around the search string. Somehow I need to ignore HTML tags between
> the searched strings while replacing within the placeholder content.
> Is there any other way I can achieve this?
> e.g.
> User wants to update reference of "This is <b>test</b>" from all
> postings to "This is an updated test". So either I find a regular
> expression which ignores all HTML tags in between search string, or
> use any other mechanism which does this for me.
>
> Appreciates any thoughts on this.
>
> Regards,
> Mahesh
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com