RESULTS:
Execution Time(sec.):
0.000010
Raw Match Pattern:
&(?![^& ]+;)
Raw Replace Pattern:
&
C#.NET Code Example:
using System;
using System.Text.RegularExpressions;
namespace myapp
{
class Class1
{
static void Main(string[] args)
{
String sourcestring = "source string to match with pattern";
String matchpattern = @"&(?![^& ]+;)";
String replacementpattern = @"&";
Console.WriteLine(Regex.Replace(sourcestring,matchpattern,replacementpattern));
}
}
}
$sourcestring after replacement:
"tom & jill" should become "tom & jill"
"tom & jill" should remain "tom & jill"
"tom € jill" should remain "tom € jill"
"tom <&> jill" should become "tom <&> jill"
"tom "&" jill" should become "tom "&" jill"