using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^assertEquals\(\s*(?<one>[^,]+)\s*,\s*(?<two>[^,]+)\s*,\s*(?<three>[^,;]+)\s*\);$";
string input = @"assertEquals(""Size : Actual not as expected "", 3, existingEntity.getProperties().size());
assertEquals(""Size : Actual not as expected "", 2, properties.size());
assertEquals(""Verify CreatedBy"", ""SYSTEM"", createdBy);
assertEquals(""Verify ModifyBy"", ""JSS"", existingUser.getModifiedBy());
existingUser.setFirstName(""changed user name"");
existingUser.setEmail(""changed_user@domain.com"");
existingUser.setTrustGroupId(""TRG02"");
existingUser.setUuid(""UUID200"");
// Query - Save (update)
// need to flush as within a non-committed transaction at this stage
this.userRepository.saveAndFlush(existingUser);";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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