I had to look back a few months in the messages to try to find a solution to this problem and since it looked like a few other people were looking for a similar solution I thought I would share what I have found.<BR><BR>First the function:<BR>--------------<BR>Function RegExpReplace(strInput, strPattern, strReplace)<BR> &#039; Use &#060;?&#062; to indicate the match you wish to replace<BR><BR> &#039; Create and setup several variables:<BR> Dim regEx, Match, Matches, Position, strReturn<BR> Position = 1<BR> strReturn = ""<BR><BR> &#039; Set up the regular expression:<BR> Set regEx = New RegExp<BR> regEx.Pattern = strPattern<BR> regEx.IgnoreCase = True<BR> regEx.Global = True<BR><BR> &#039; Get all the matches for it:<BR> Set Matches = regEx.Execute(strInput)<BR><BR> &#039; Go through the Matches collection<BR> &#039; and build the output string:<BR> For Each Match in Matches<BR> strReturn = strReturn & Mid(strInput, Position, Match.FirstIndex+1-Position)<BR> strReturn = strReturn & Replace(strReplace, "&#060;?&#062;", Match.Value)<BR> Position = Len(Match.Value) + Match.FirstIndex + 1<BR> Next<BR><BR> &#039; Add any text after the last match<BR> strReturn = strReturn & Mid(strInput, Position, Len(strInput))<BR><BR> RegExpReplace = strReturn<BR>End Function<BR>--------------<BR>This was grabbed right from the previous post which came from this article: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=66<BR><BR>But the example in the previous article didn&#039;t quite work for me...<BR>--------------<BR>strHTML = RegExpReplace(strHTML, "strong(?![^&#060;]+&#062;), "*&#060;?&#062;*")<BR>--------------<BR>...it kept replacing text in html tags as well as text not in html tags. So, I banged around with it and came up with this modification:<BR>--------------<BR>strHTML = RegExpReplace(strHTML, "(?![^&#060;]+&#062;)" + strSearch + "(?![^&#060;]+&#062;)", strReplace)<BR>--------------<BR>strSearch is the text that I&#039;m looking for and strReplace is what I want to replace it with. I&#039;ve done a few quick tests and it seems to be working well.<BR><BR>Hope this helps!<BR>Jonathan Snook<BR>