473,574 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 19 '05 #1
9 3122
> and i was wondering if you guys know how to make the words test, car and
goose bold if exists in rs("text")?


http://www.aspfaq.com/2344
Jul 19 '05 #2
Tim
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]" <aa***@TRASHasp faq.com> wrote in message
news:uC******** ******@TK2MSFTN GP12.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")?


http://www.aspfaq.com/2344

Jul 19 '05 #3
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:
http://www.aspfaq.com/show.asp?id=2344

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
Jul 19 '05 #4
> 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?
Jul 19 '05 #5
Gazing into my crystal ball I observed "Bob Barrows"
<re******@NOyah oo.SPAMcom> writing in
news:Op******** ******@TK2MSFTN GP12.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:
http://www.aspfaq.com/show.asp?id=2344

but the link Aaron provided should have worked. What happens when you
click it?


When I use www.aspfaq.com/2344 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
http://www.arbpen.com
Jul 19 '05 #6
On Mon, 06 Oct 2003 21:54:48 GMT, Adrienne <ar****@sbcglob al.net>
wrote:
in <Xn************ *************** *@207.115.63.15 8>
Gazing into my crystal ball I observed "Bob Barrows"
<re******@NOya hoo.SPAMcom> writing in
news:Op******* *******@TK2MSFT NGP12.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:
http://www.aspfaq.com/show.asp?id=2344

but the link Aaron provided should have worked. What happens when you
click it?


When I use www.aspfaq.com/2344 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.
Jul 19 '05 #7
Tim
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" <aa***@TRASHasp faq.com> wrote in message
news:O5******** ******@tk2msftn gp13.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?

Jul 19 '05 #8
> 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.
Jul 19 '05 #9
Tim
I seem to have touched a nerve - sorry - didn't mean to.

Tim
"Aaron Bertrand [MVP]" <aa***@TRASHasp faq.com> wrote in message
news:eu******** ******@TK2MSFTN GP11.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.

Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1526
by: exBK | last post by:
I need to replace certain words in a string as below: strTitle="Microsoft test title for project ABC"; strKeywords="title project"; what I want to do is: "Bold" the keywords "title" and "project" in the string strTitle. Microsoft test <b>title</b> for <b>project</b> ABC Any suggestions on how to do this one ? I am trying to do it in...
3
8876
by: gregpinero | last post by:
I'm trying to write a little script that will have a list of word pairs which will loop through that list and replace all instances of each word with the other word. I'm very new to javascript so I'm not quite sure where to get started. Here is my python "prototype" in case you want a better idea of what I'm trying to do: <code>...
1
3698
by: Raterus | last post by:
Howdy, I'm making a search engine for an application I'm working on. I want to "bold" keywords they have searched for. I have a long string of words that represents a particular document, and I need to find out how to do a replace on this string, but have it be case-insensitive. For instance: dim docWords as string = "BLAH blah BlaH!"...
31
3228
by: metaperl | last post by:
-- python -i File "<stdin>", line 1 class = "algebra" ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class definition but class followed by equals is a simple assignment?
2
5073
by: Ola K | last post by:
Hi guys, I wrote a script that works *almost* perfectly, and this lack of perfection simply puzzles me. I simply cannot point the whys, so any help on it will be appreciated. I paste it all here, the string at the beginning explains what it does: '''A script for MS Word which does the following: 1) Assigns all Hebrew italic characters...
8
2702
by: John Pye | last post by:
Hi all I have a file with a bunch of perl regular expressions like so: /(^|)\*(.*?)\*(|$)/$1'''$2'''$3/ # bold /(^|)\_\_(.*?)\_\_(|$)/$1''<b>$2<\/ b>''$3/ # italic bold /(^|)\_(.*?)\_(|$)/$1''$2''$3/ # italic
3
3948
by: Hvid Hat | last post by:
Hi I want to highlight (make it bold) a word in some text I'm getting in XML format. My plan was to replace the word with a bold (or span) tag with the word within the tag. I've found the code below and it works fine as long as I'm not adding tags around the to parameter. Can anyone explain to me why it doesn't work with tags? And it needs...
1
1572
by: thumban | last post by:
Hi, i am trying to read a Word Document, and replace all bold words in it with some other text.How can i find out the bold words?? Thanks in advance, Thumban
7
2167
by: Hvid Hat | last post by:
Hello How should I go about marking certain words in a text? I've got a list of words: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="Mark.xsl"?> <Words> <Word> <Acronym>XML</Acronym>
0
7793
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7710
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8222
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8092
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6437
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5606
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5296
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2230
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.