Regular Expressions....HELP!

  • Thread starter Thread starter Stephajn Craig
  • Start date Start date
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?
 
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).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think Outside the Box!
****************************************************************************
****
 
Back
Top