using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
Regex _imagePatterns = new Regex(@"images\/[a-zA-Z0-9\-]+\.(svg|png|gif|jpeg|jpg)");
string[] _imageExtensions = new[] { "svg", "png", "gif", "jpeg", "jpg" };
string postHtml = "{\"promotionContent\":\"{0}/html/e1e27cf4-f177-4c56-b0ca-d6c0d52e85d01656584804015.html\",\"promotionThumbnailDesktopPath\":\"{0}/images/033f83e8-0948-48c3-bbaf-36e43e07f2881656584761920.jpg\",\"promotionThumbnailMobilePath\":\"{0}/images/3d632eff-56fd-486b-8a59-eaecbcd944c51656584764843.jpg\",\"promotionLabel\":2,\"promotionLabelStartDate\":\"2022-06-30T18:35:44.1139297+08:00\",\"promotionAction\":\"Deposit\",\"promotionRepeatType\":\"None\"}";
MatchCollection matches = _imagePatterns.Matches(postHtml);
List<string> imageNames = matches
.SelectMany(x => x.Captures)
.Select(g => Path.GetFileNameWithoutExtension(g.Value))
imageNames.ForEach(Console.WriteLine);