Regular Expressions....HELP!

S

Stephajn Craig

I'm thinking that I need to use a regular expression to make this work, but
I'm not expert at them.

What I'd like to do is be able to search a document for a specific word or
words and when found, have them highlighted. However, these words may also
be part of a filename. For example, let's say I'm searching through HTML
content for the word foo. All instances of foo can be easily found using
the Replace command and replacing them with foobar. However, suppose foo is
also part of another word in the document like say, an image filename called
food.gif. Replacing foo in this case would cause food.gif to become
foobard.gif.

So, the replace command does only half of the job. The other half sounds
like it has to be done in a regular expression. Can anyone help me with
this or point me in the right direction?
 
C

Cowboy \(Gregory A. Beamer\)

If the word food is the issue, it will have spaces around it, while food.gif
will not. You can do a search for food, and perhaps "food " and " food" and
get all of the instances. In a web app, you can alter the words and add
something that highlights them, like a style (CSS).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top