using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?:Product (\d{6})(\d{8}) (.{12}) (.+)\s?\*BCA)+";
string input = @"Account balance PLM051 05May2016 10:54
Actions Submenu View authorisation balance details
View available balance detailsExit
Product 40256731631234 BUSINESS A/C Zapp Innovat*BCA
Balances as at 05May2016 10:54 except where indicated
Balance 907.50Cr
Statement balance 1,059.50Cr (04May2016)
Cleared balance 907.50Cr
Interest balance 1,059.50Cr (04May2016)
Available balance 793.56Cr
Authorisation balance 793.56Cr
Other details
Account balance PLM051 05May2016 10:54
Actions Submenu View authorisation balance details
View available balance detailsExit
Product 40256731631234 BUSINESS A/C Zapp Innovat*BCA
Balances as at 05May2016 10:54 except where indicated
Balance 907.50Cr
Statement balance 1,059.50Cr (04May2016)
Cleared balance 907.50Cr
Interest balance 1,059.50Cr (04May2016)
Available balance 793.56Cr
Authorisation balance 793.56Cr
Other details
";
foreach (Match m in Regex.Matches(input, pattern))
{
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