use strict;
my $str = 'Frontken Corporation Berhad (651020-T) 85
ANNUAL REPORT 2018
Notes To The Financial Statements
(cont’d)
9. EARNINGS PER SHARE
Basic earnings per share is calculated by dividing profit after taxation attributable to owners of the Company by the weighted
average number of ordinary shares in issue during the financial year.
The Group
2018 2017
Profit after taxation attributable to owners of the Company (RM) 52,256,898 29,857,681
Number of shares in issue as of 1 January 1,053,435,130 1,053,435,130
Effects of:
Treasury shares acquired (5,466,600) (5,466,600 )
Weighted average number of ordinary shares for basic earnings
per share computation as of 31 December 1,047,968,530 1,047,968,530
Basic earnings per ordinary share attributable
to equity holders of the Company (sen) 4.99 2.85
The Group has not issued any dilutive potential ordinary shares and hence, the diluted earnings per share is equal to the basic
earnings per share.
';
my $regex = qr/(^[A-Z]).*\n[A-Za-z 1-9]*\s(\d)*\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