use strict;
my $str = '71901%
71902%
71903%
71909%
71910%
71911%
71912%
71913%
71914%
71949%
71950%
71951%
71956%
71964%
71968%
72087%
71834%
71937%
71839%
71840%
71854%
71724%
71730%
71731%
71747%
71749%
71750%
71758%
71759%
71762%
71765%
71768%
75501%
75503%
75504%
75505%
75507%
75559%
75561%
75567%
75569%
75570%
75573%
75574%
75599%
';
my $regex = qr/7(?:1(?:7(?:24|3[01]|4[79]|5[089]|6[258])|8(?:3[49]|40|54)|9(?:0[1239]|1[034]|37|49|5[16]|6[48]))|2087|55(?:0[13457]|59|6[179]|7[034]|99))%/p;
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