Regular Expression Question

Discussion in 'ASP General' started by Gianni Brasco, Oct 3, 2004.

  1. Hi there...i have a little regexp question. i'm trying to do a search
    and replace for this static ecommerce site. i need to change the
    status of the products availablity from "yes" to "no". I have a
    script that searches all the html pages by the product ID. I am able
    to find the necessary page where I will need to update the text, but I
    am having trouble searching and replacing within the document.

    Here is some sample code that I'm searching:

    <font color="#CCCCCC">available: <font color="#FFFFFF">yes<br>
    </font>item #: <font
    color="#FFFFFF">cd-213</font></font></font></font>

    cd-213 is the product code. i would like to build a regular
    expression that finds the first instance of "yes" before the product
    code and replace that text with the word "no". in this case it's
    cd-213.

    hopefully someone can help me. right now i'm doing a wild card search
    that finds the first instance of yes, then everything in between until
    the product code is found. not what I want :(

    thanks!
     
    Gianni Brasco, Oct 3, 2004
    #1
    1. Advertising

  2. Gianni Brasco

    John Guest

    Look for NAME and ID together with TD
    and for innerHtml
    and Javascript to alter the content


    "Gianni Brasco" <> schreef in bericht
    news:...
    > Hi there...i have a little regexp question. i'm trying to do a search
    > and replace for this static ecommerce site. i need to change the
    > status of the products availablity from "yes" to "no". I have a
    > script that searches all the html pages by the product ID. I am able
    > to find the necessary page where I will need to update the text, but I
    > am having trouble searching and replacing within the document.
    >
    > Here is some sample code that I'm searching:
    >
    > <font color="#CCCCCC">available: <font color="#FFFFFF">yes<br>
    > </font>item #: <font
    > color="#FFFFFF">cd-213</font></font></font></font>
    >
    > cd-213 is the product code. i would like to build a regular
    > expression that finds the first instance of "yes" before the product
    > code and replace that text with the word "no". in this case it's
    > cd-213.
    >
    > hopefully someone can help me. right now i'm doing a wild card search
    > that finds the first instance of yes, then everything in between until
    > the product code is found. not what I want :(
    >
    > thanks!
     
    John, Oct 5, 2004
    #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. Andrew Munn

    Regular expression question...

    Andrew Munn, Jun 29, 2003, in forum: Perl
    Replies:
    1
    Views:
    2,161
    rakesh sharma
    Jun 30, 2003
  2. Glenn Kidd

    Regular expression question

    Glenn Kidd, Aug 18, 2003, in forum: Perl
    Replies:
    0
    Views:
    943
    Glenn Kidd
    Aug 18, 2003
  3. VSK
    Replies:
    2
    Views:
    2,355
  4. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    873
    Alan Moore
    Dec 2, 2005
  5. GIMME
    Replies:
    3
    Views:
    12,025
    vforvikash
    Dec 29, 2008
Loading...

Share This Page