using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(<img\s[^>]*?data-src-l\s*=\s*['\""])([^'\""]*?['\""])([^>]*?>)";
string substitution = @"$1http://www.asaphshop.nl$2$3";
string input = @"<li>
<a href=""/WebRoot/products/8020/80203122/bilder/80203122.jpg"">
<img
itemprop=""image""
alt=""Jesus Remember Me - Taize Songs (2CD)""
src=""/WebRoot/AsaphNL/Shops/asaphnl/5422/8F43/62EE/D698/EF8E/4DEB/AED5/3B0E/80203122_xs.jpg""
data-src-xs=""/WebRoot/AsaphNL/Shops/asaphnl/5422/8F43/62EE/D698/EF8E/4DEB/AED5/3B0E/80203122_xs.jpg""
data-src-s=""/WebRoot/products/8020/80203122/bilder/80203122_s.jpg""
data-src-m=""/WebRoot/products/8020/80203122/bilder/80203122_m.jpg""
data-src-l=""/WebRoot/products/8020/80203122/bilder/80203122.jpg""
/>
</a>
</li>
</ul>";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx