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:
[quote]
Pre: <img src=“data:image/gif;base64,”>[/quote]
What am I doing wrong here?