I need to replace all the src attributes values in a HTML body. Typically it contains values like below and I need to remove the junk value starting from ‘@’ and it should only contain till that extension followed by double quotes.
src=“cid:image002.png@01DB91BB.D6446500”
src=“cid:image001.png@01DB91BB.D6446500”
src=“cid:image007.jpg@01DB91BC.13B8F810”
Use the regex cid:[^@]+ to match the src attribute, then replace it using System.Text.RegularExpressions.Regex.Replace(inputHtml, “cid:[^@]+”, “$1”) to remove the junk after the @ and keep only the file name with the extension.