Replacing the specific pattern of text in a huge text string..

Discussion in 'ASP .Net' started by Brown Smith, Jun 24, 2005.

  1. Brown Smith

    Brown Smith Guest

    At run time I am building the HTML table as follows for literal control.



    HTML Table related data ...

    <span style='background-color: #FFDD00'>could be any data here LIKE DATA 1
    </span>

    HTML Table related data ...

    <span style='background-color: #FFDD00'>could be any data here NNNN</span>

    HTML Table related data ...

    <span style='background-color: #FFDD00'>could be any data here..</span>

    ...

    HTML Table related data ...

    <span style='background-color: #FFDD00'>could be any data here5555</span>

    ......



    In certain cases as part of business requirement I need to change the text
    in between the strings as follows <span style='background-color:
    #FFDD00'>Data Not Available</span> for all occurrence of starting string
    "<span style='background-color: #FFDD00'>" and ending string "</span>".

    How to write an efficient code for this? Instead of string manipulations I
    would like to do use regular expressions for this.

    Thanks for thinking to help me.

    I am using .Net 1.1.

    Smith
    Brown Smith, Jun 24, 2005
    #1
    1. Advertising

  2. Brown Smith

    Frankie Guest

    I don't have a specific reg ex for you, but here is a great resource you
    might want to know about if you don't already know about it:
    http://www.regexlib.com/


    -HTH



    "Brown Smith" <> wrote in message
    news:u3%...
    > At run time I am building the HTML table as follows for literal control.
    >
    >
    >
    > HTML Table related data ...
    >
    > <span style='background-color: #FFDD00'>could be any data here LIKE DATA
    > 1
    > </span>
    >
    > HTML Table related data ...
    >
    > <span style='background-color: #FFDD00'>could be any data here NNNN</span>
    >
    > HTML Table related data ...
    >
    > <span style='background-color: #FFDD00'>could be any data here..</span>
    >
    > ..
    >
    > HTML Table related data ...
    >
    > <span style='background-color: #FFDD00'>could be any data here5555</span>
    >
    > .....
    >
    >
    >
    > In certain cases as part of business requirement I need to change the text
    > in between the strings as follows <span style='background-color:
    > #FFDD00'>Data Not Available</span> for all occurrence of starting string
    > "<span style='background-color: #FFDD00'>" and ending string "</span>".
    >
    > How to write an efficient code for this? Instead of string manipulations I
    > would like to do use regular expressions for this.
    >
    > Thanks for thinking to help me.
    >
    > I am using .Net 1.1.
    >
    > Smith
    >
    >
    Frankie, Jun 25, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    17
    Views:
    1,832
    Chris Uppal
    Nov 16, 2005
  2. Replies:
    3
    Views:
    475
  3. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    256
    Chris Hohmann
    Apr 11, 2005
  4. Kevin
    Replies:
    7
    Views:
    174
    Kevin
    May 17, 2011
  5. ChrisC
    Replies:
    4
    Views:
    158
    ChrisC
    Jun 25, 2010
Loading...

Share This Page