using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(GSTIN No:-): (.*?\d\s)";
string substitution = @"$1,$2 in $3:";
string input = @"TAX INVOICE CA MANIN DER SINGH AND ASSOCIATES 253 B 1/12 APSARA ARCADE PUSA ROAD.NEW DELHl-110005 GSTIN No 07APAFD8365H1Z9 Bill to Place of Supply INVOICE No Dated RK Electrical Works RK Electrical Works A-240 Palam Vihar, Delhi GSTIN No:-07BBUPS5612K1Z9 Description of Services Professional Services for Month of July Total Less Discount Taxable Value ADDCGST9% ADDSGST9% Total Amount Chargeable (in words) Rupees One Lac Eighteen Thousand Only Company's PAN: AAKFD6723D Note-Please make cheques in favor of ""CA Maninder Singh and Associates"" A-240 Palam Vihar, Delhi MSA-Tl-02 1-Jul-17 SAC CODE Amount 9982 100000 100000 0 100000 9% 9000 9% 9000 118000.00 For CA Maninder Singh & Associates Authorised Signatory ()-";
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