// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?m)(GSTIN No:-): (.*?\d\s)").unwrap();
let string = "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 ()-";
let substitution = "$1,$2 in $3:";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
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 Rust, please visit: https://docs.rs/regex/latest/regex/