Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Help building regular expression to find red color font tag and replace it

Last post 06-30-2008, 12:25 PM by saira. 2 replies.
Sort Posts: Previous Next
  •  06-27-2008, 1:54 PM 43545

    Help building regular expression to find red color font tag and replace it

    Hi All,

    I would really appreciate if someone could help me build a regular expression that ignores the cases and looks for:

     <Font color ="red"> **text** </FONT> and replaces it by attaching a span tag around it  

     <span> <Font color ="red"> **text** </FONT></span>.

    Thanking you in anticipation!

    -Saira. 

     

     

     

     

  •  06-29-2008, 7:26 PM 43590 in reply to 43545

    Re: Help building regular expression to find red color font tag and replace it

    Saira,

    I realise that it is in a companion forum to this ine, but the sticky note at http://regexadvice.com/forums/thread/43218.aspx will tell you the basic information that you need to provide us so that we can help you.

    Having said that, the 'ignore case' option is fairly standard on most regex engines and will cause upper and lower case character to be treated the same.

    Also most regex engines provide a 'replace' function that will make the changes that you are after.

    However, if the 'font' tags can be nested then things get very different depending on the regex engine you are using. Also, I'm assuming that there are multiple occurrences of this within your text, so ca nwe see an example of the real text you are working on?

    Also, which parts of the tag are constant and which are variable? Can there be other attributes within the opening tag? Is the colour always 'red'?

    Susan 

  •  06-30-2008, 12:25 PM 43611 in reply to 43590

    Re: Help building regular expression to find red color font tag and replace it

    Hi Susan,

    Thanks much for your suggestions. Sorry wasn't very clear in my previous msg.

    However, I am using .Net engine. I found this tool online which helped me
    build the expression.

    http://www.ultrapico.com

    Thanks for all your help. Appreciate it!

    -Saira.

View as RSS news feed in XML