RESULTS:
Execution Time(sec.):
0.000008
Raw Match Pattern:
(NM1\*IL\*1\*)(?<LastName>[a-zA-Z0-9]{0,60})(\*[a-zA-Z0-9]{0,35}\*\*\*\*MI\*[a-zA-Z0-9]{2,80}~)
Raw Replace Pattern:
\1NewLastName\3
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 = @"(NM1\*IL\*1\*)(?<LastName>[a-zA-Z0-9]{0,60})(\*[a-zA-Z0-9]{0,35}\*\*\*\*MI\*[a-zA-Z0-9]{2,80}~)";
String replacementpattern = @"\1NewLastName\3";
Console.WriteLine(Regex.Replace(sourcestring,matchpattern,replacementpattern));
}
}
}
$sourcestring after replacement:
ISA*PERRY~NM1*IL*1*NewLastName*CHRISTOPHER****MI*1234567890A~IEA~