use strict;
my $str = 'The first <a href="/tggsp/english/SignificantTermsDetail/Pauri" target="_blank" class="DirectLinkSigWord"><i>pauri</i></a> <sup><i class="far fa-edit" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="" data-content="‘Pauri’ is a distinct pattern or a verse structure of Panjabi heroic-poetry (var). For detail please see ‘Asa Ki Var: Introduction.’<br/>" data-original-title=""></i></sup><i> </i>is accompanied by three <i>saloks</i><sup><i class="far fa-edit" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="" data-content="‘Salok’ is a poetic form, literally meaning ‘praise.’ Saloks ranging from one to twenty-six lines can be found in the Guru Granth Sahib, although most of the saloks are two lines long. For detail please see ‘Asa Ki Var: Introduction.’<br/>" data-original-title=""></i></sup><i>.</i> The first and second <i>saloks </i>contain two lines each, while the third <a href="/tggsp/english/SignificantTermsDetail/Salok" target="_blank" class="DirectLinkSigWord"><i>salok </i></a> contains four lines. In the first two <i>saloks</i>, after an invocation to the Guru, the importance of the Guru in human life is stressed. In the third <a href="/tggsp/english/SignificantTermsDetail/Salok" target="_blank" class="DirectLinkSigWord"><i>salok</i></a> , it is clarified that individuals without the Guru (Wisdom), might appear to be wise, intelligent, and successful from a worldly perspective, but despite this, they remain spiritually valueless (without virtues). Without the Guru’s wisdom, human life remains unilluminated and worthless. The <a href="/tggsp/english/SignificantTermsDetail/Pauri" target="_blank" class="DirectLinkSigWord"><i>pauri </i></a> explains that the formless One first created Ownself and<a href="/tggsp/english/SignificantTermsDetail/Nam" target="_blank" class="DirectLinkSigWord"> Nam,</a> and then created the creation, before pervading within it.';
my $regex = qr/<sup[^>]*>[^<]*<\/sup|(‘Pauri’)/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