Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP and Smilies?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

How could I use asp to replace ":)" with a smilie image?

eg :

If someone types :) it would show as
smiletiniest.gif


Thanks.
 
Dave,

I don't have the code in front of me, but do something like this. First set up a regexp obj. Set up a pattern...

dim somestring="hello there :)"

set re=new regexp
re.pattern=":)"

then do a test for the text that could possibly match the pattern...

if re.test(somestring)then
'switch the matching pattern with <img src=&quot;smilie.gif&quot;>
end if

Sorry I don't have all the code for you, but this is what you need to do (I haven't worked with asp's regexp object in a while so I am rusty on it).

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top