This is just printing '<'. But the output needed is#!/usr/bin/perl my $line; while (my $line = <DATA>){ $line =~ s/<span><p>(.*)/defined ($1) ? "<" : '</p><p>'/eg; print $line; } __DATA__ <span><p>This affected me deeply because < I was being treated for dep +ression then. < felt she was replacing me as mother and grandmother.
<span><p>This affected me deeply because </p><p> I was being treated f +or depression then. </p><p> felt she was replacing me as mother and g +randmother.
In reply to Re^6: substitute character
by gem555
in thread substitute character
by gem555
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |