use strict;
my $str = 'El\\r\\n_I ERNST&YOUNC Expense Report\\r\\nI Date Prepared: 01-08-2019 I Managing Country: XE I\\r\\nI Submitted: 01-08-2019 (In Audit) | Business Unit: XE045 I\\r\\n| GPN - Name: XE021000618 — Paul Prashanth | Management Unit: 00801 Sub Management Unit: 0907302 |\\r\\nI Signature: I Approved By: Rank: I\\r\\nI Rank: Administrative Contractor I Approval Signature: I\\r\\nI Expense Details (Attach supporting receipts) I Total Net IC = Chargeable P = Authorized I\\r\\nI Loc I Expense Type I Date I Description I Expense Expense I Type I Engagement I Activity I\\r\\nOTHER International Travel-Non-Billable - Ground 01-08-2019 Need clarification for claiming the taxi expenses P 33800872 0000\\r\\nTransportation - Mass/Public Transportation from same vendor for INR 2400 & No receipts fo\\r\\nTelephone for GBP l (INR 97.89) & Taxi for GB\\r\\n25 (INR 2470.75) Barcode : 2170270878\\r\\nI IIIIII IIIII IIIII IIIII IIIII IIIII IIIII IIIII IIIII IIIII IIII IIII Tom’s I 0.00 I 0.00 I Tom] KilometreSI I\\r\\n* 2 1 7 1 9 5 9 5 2 8 it Report Date Format: dd-mm-yyyy\\r\\nPage 1 of 1 10-06-2020';
my $regex = qr/(?<=KilometreSI I\\r\\n\*).[0-9\s]+/mp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
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 Perl, please visit: http://perldoc.perl.org/perlre.html