Professional Web Applications Themes

replace words with bold words - ASP

Hello I was wondering if you guys could help me solve this using reg exp, i have a searchpage and a variable keywords that holds a number of words. e.g keywords = "test car goose" ...... <% do until rs.eof %> <%=rs("text")%> and i was wondering if you guys know how to make the words test, car and goose bold if exists in rs("text")? /Lasse...

  1. #1

    Default replace words with bold words

    Hello

    I was wondering if you guys could help me solve this using reg exp,

    i have a searchpage and a variable keywords that holds a number of words.


    e.g

    keywords = "test car goose"

    ......
    <%
    do until rs.eof
    %>

    <%=rs("text")%>

    and i was wondering if you guys know how to make the words test, car and
    goose bold if exists in rs("text")?

    /Lasse


    Lasse Edsvik Guest

  2. #2

    Default Re: replace words with bold words

    > and i was wondering if you guys know how to make the words test, car and
    > goose bold if exists in rs("text")?
    [url]http://www.aspfaq.com/2344[/url]


    Aaron Bertrand [MVP] Guest

  3. #3

    Default Re: replace words with bold words

    what's the point in posting a link that doesn't work properly?
    why not just answer the question?
    I know you want to drive lots of traffic to your site but it doesn't seem to
    be the most user-freindly way of replying.


    Tim


    "Aaron Bertrand [MVP]" <aaronTRASHaspfaq.com> wrote in message
    news:uCHnp21iDHA.2328TK2MSFTNGP12.phx.gbl...
    > > and i was wondering if you guys know how to make the words test, car and
    > > goose bold if exists in rs("text")?
    >
    > [url]http://www.aspfaq.com/2344[/url]
    >
    >

    Tim Guest

  4. #4

    Default Re: replace words with bold words

    Tim wrote:
    > what's the point in posting a link that doesn't work properly?
    The link works fine for me.

    Granted, this syntax would probably have been safer:
    [url]http://www.aspfaq.com/show.asp?id=2344[/url]

    but the link Aaron provided should have worked. What happens when you click
    it?
    > why not just answer the question?
    Why not post a link if it contains the answer to the question. That's the
    purpose of creating a FAQ, isn't it? So people asking FAQ's can be directed
    to the page containing the answer ...

    We answer hundreds of questions every day. We should not be criticized for
    using time-savers such as posting links to relevant pages.
    > I know you want to drive lots of traffic to your site but it doesn't
    > seem to be the most user-freindly way of replying.
    >
    It's the old saying: if I give a fish to a hungry person, he has dinner for
    that evening. If I teach him to fish, he has dinner for the rest of his
    life.

    By directing a person to a FAQ site, or to the results of a Google search,
    we are making the person aware that there are resources available whch he
    either overlooked, or was not aware of, resources which will probably get
    him answers to his questions much quicker than can be expected from a
    newsgroup, where questions can be left unanswered for hours, even days if no
    one notices them.

    Bob Barrows


    Bob Barrows Guest

  5. #5

    Default Re: replace words with bold words

    > what's the point in posting a link that doesn't work properly?

    What does "doesn't work properly" mean?
    > why not just answer the question?
    Because it's been answered before, and I don't think I should waste time
    constructing the exact same answer over and over again when, instead, I can
    point the user to a link and answer any follow-up questions. And the time I
    *didn't* spend constructing the same answer from scratch, I can use to
    answer five other questions instead.
    > I know you want to drive lots of traffic to your site
    Really? What would I get out of that? There are no advertisements, the
    site is free, and there is no tangible benefit to "drive lots of traffic"
    there... except that more traffic means a potentially more expensive hosting
    bill due to bandwidth consumption and database usage. So, yes, you must be
    right, I just want to drive traffic to my web site.
    > but it doesn't seem to
    > be the most user-freindly way of replying.
    That may be your opinion. Based on the feedback (and donations) I get from
    my *free* and *ad-free* web site, I would guess that you're in the minority.

    You're new around here, huh?


    Aaron Bertrand - MVP Guest

  6. #6

    Default Re: replace words with bold words

    Gazing into my crystal ball I observed "Bob Barrows"
    <reb01501NOyahoo.SPAMcom> writing in
    news:OpBw21BjDHA.2160TK2MSFTNGP12.phx.gbl:
    >> what's the point in posting a link that doesn't work properly?
    >
    > The link works fine for me.
    >
    > Granted, this syntax would probably have been safer:
    > [url]http://www.aspfaq.com/show.asp?id=2344[/url]
    >
    > but the link Aaron provided should have worked. What happens when you
    > click it?
    >
    >
    When I use [url]www.aspfaq.com/2344[/url] it goes to wholelist.asp. This might be
    because I use Opera, and maybe the site is doing some kind of browser
    sniffing so I don't get the nice menu on the side.

    No biggie, though. I just type the article in Opera's search box, and jump
    right to it, although I _would_ like to have the nice menu on the side.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    [url]http://www.arbpen.com[/url]
    Adrienne Guest

  7. #7

    Default Re: replace words with bold words

    On Mon, 06 Oct 2003 21:54:48 GMT, Adrienne <arbpensbcglobal.net>
    wrote:
    in <Xns940C97BDD3A13arbpenyahoocom207.115.63.158>
    >Gazing into my crystal ball I observed "Bob Barrows"
    ><reb01501NOyahoo.SPAMcom> writing in
    >news:OpBw21BjDHA.2160TK2MSFTNGP12.phx.gbl:
    >
    >>> what's the point in posting a link that doesn't work properly?
    >>
    >> The link works fine for me.
    >>
    >> Granted, this syntax would probably have been safer:
    >> [url]http://www.aspfaq.com/show.asp?id=2344[/url]
    >>
    >> but the link Aaron provided should have worked. What happens when you
    >> click it?
    >>
    >>
    >
    >When I use [url]www.aspfaq.com/2344[/url] it goes to wholelist.asp. This might be
    >because I use Opera, and maybe the site is doing some kind of browser
    >sniffing so I don't get the nice menu on the side.
    >
    >No biggie, though. I just type the article in Opera's search box, and jump
    >right to it, although I _would_ like to have the nice menu on the side.
    It behaves the same way here. If you change quick preferences to
    identify as IE 6 then the site appears as intended.
    Stefan Berglund Guest

  8. #8

    Default Re: replace words with bold words

    no - not new - far from it - just in the mood for questioning the things we
    take for granted. a bit of a habit of mine I'm afraid.
    by the way - your site doesn't pick me up as an IE user as I have modified
    my browser header to make me look like an Amiga - and I forgot. sorry!
    Don't you cater for Amigas? (joke by the way)

    ps - a slight contradiction in your answer
    compare
    "There are no advertisements, the site is free, and there is no tangible
    benefit to drive lots of traffic there"
    with
    "Based on the feedback (and donations) I get..."

    don't forget the ego thing as well. we all have sites we do for free, we
    just like to feel popular. did you have a disturbed childhood?


    cheers ;-)

    Tim




    "Aaron Bertrand - MVP" <aaronTRASHaspfaq.com> wrote in message
    news:O5XmduDjDHA.4048tk2msftngp13.phx.gbl...
    > > what's the point in posting a link that doesn't work properly?
    >
    > What does "doesn't work properly" mean?
    >
    > > why not just answer the question?
    >
    > Because it's been answered before, and I don't think I should waste time
    > constructing the exact same answer over and over again when, instead, I
    can
    > point the user to a link and answer any follow-up questions. And the time
    I
    > *didn't* spend constructing the same answer from scratch, I can use to
    > answer five other questions instead.
    >
    > > I know you want to drive lots of traffic to your site
    >
    > Really? What would I get out of that? There are no advertisements, the
    > site is free, and there is no tangible benefit to "drive lots of traffic"
    > there... except that more traffic means a potentially more expensive
    hosting
    > bill due to bandwidth consumption and database usage. So, yes, you must
    be
    > right, I just want to drive traffic to my web site.
    >
    > > but it doesn't seem to
    > > be the most user-freindly way of replying.
    >
    > That may be your opinion. Based on the feedback (and donations) I get
    from
    > my *free* and *ad-free* web site, I would guess that you're in the
    minority.
    >
    > You're new around here, huh?
    >
    >

    Tim Guest

  9. #9

    Default Re: replace words with bold words

    > ps - a slight contradiction in your answer

    I disagree completely.
    > "There are no advertisements, the site is free, and there is no tangible
    > benefit to drive lots of traffic there"
    > with
    > "Based on the feedback (and donations) I get..."
    Obviously the latter are the people who appreciate the site, rather than
    make snide comments about it. Just driving traffic there does not =
    donations.


    Aaron Bertrand [MVP] Guest

  10. #10

    Default Re: replace words with bold words

    I seem to have touched a nerve - sorry - didn't mean to.



    Tim


    "Aaron Bertrand [MVP]" <aaronTRASHaspfaq.com> wrote in message
    news:euIVfaMjDHA.3644TK2MSFTNGP11.phx.gbl...
    > > ps - a slight contradiction in your answer
    >
    > I disagree completely.
    >
    > > "There are no advertisements, the site is free, and there is no tangible
    > > benefit to drive lots of traffic there"
    > > with
    > > "Based on the feedback (and donations) I get..."
    >
    > Obviously the latter are the people who appreciate the site, rather than
    > make snide comments about it. Just driving traffic there does not =
    > donations.
    >
    >

    Tim Guest

Similar Threads

  1. Replace words into a string with a space before or after
    By Francesco Moi in forum PERL Miscellaneous
    Replies: 3
    Last Post: August 20th, 01:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139