Regex replacement question

I’m trying to embed images into html. The Regex pattern is working. The replacement pattern works in RegexRx but not in Xojo.

dim theRegex as new RegEx theRegex.options.greedy = False theRegex.Options.TreatTargetAsOneLine = True theRegex.searchPattern = "(<img.*)(src ?= ?cid:" + ContentID + ")(.*>)" theRegex.ReplacementPattern = "\\1src=""data:image/gif;base64," + InlineImages.Value(ContentID) + """\\3" HtmlText = theRegex.Replace(HtmlText)

where ContentID is the string I’m looking for and InlineImages has the base64encoded data for the replacement.

The html is a bit long to post. Here is the relevant part:

The result is:

Pre: <img src=“data:image/gif;base64,”>[/quote]

What am I doing wrong here?

I’m not in front of my machine but try using $ instead of \ in the replacement pattern.

Using $ instead of \ doesn’t make a difference. Is this a bug? I’m going to try the MBS plugin next.

As usual it was a PEBKAC problem. I thought I had checked the replacement data but I hadn’t.