using System.Text.RegularExpressions;
using System.Collections.Generic;
public static void Main()
Dictionary<String, String> imagePathsKeys = new Dictionary<String, String>();
var content = " ";
var matches = new Regex(@"(?<=\/)(.*?)(?=\.)").Matches(content);
foreach (Match match in matches)
GroupCollection groups = match.Groups;
var guid = Guid.NewGuid().ToString();
imagePathsKeys.Add(guid, groups[0].Value);
content = content.Replace(groups[0].Value, guid);
Console.WriteLine(content);