I am New to Regex I want to convert this different case of input to Expected output.
input
CASE 1 :
<sec id="S_4"><label>2.2.6.4.</label><title><italic> Content abc (<bold>15</bold>)</italic>.</title>
CASE 2 :
<sec id="S_4"><label>2.2.6.4.</label><title><italic> Content abc (<bold>15</bold>).</italic></title><br>
CASE 3 :
<sec id="S_4"><label>2.2.6.4.</label><title><italic> Content abc (<bold>15</bold>)<bold>.</bold></italic></title>
Expected output:
<sec id="S_4"><label>2.2.6.4.</label><title> Content abc (<bold>15</bold>)</title>
I want to Remove the Punctuation at the end of the title and also remove the formating tag in the title..
please provide the regex for this.
thanks in advance.
I tried this code :: but cant able to do further
while($cnt =~m{<sec( [^>]*)?><label( [^>]+)?>(.*?)</label>)(.*?)(<title( [^>]*)?>)(.*?)</title>)}ig){
my $temp = $5;
$temp = ~s{<title( [^>]*)?>)(.*?)</title>}{}ig;
}