Learning how to parse the XML, or whatever it is, will serve you well as your needs grow.
On a quick and dirty basis:
$p = $s =~ s{\<strong\>(.*?)\</strong\>}{ $1 } ? $1 : undef ;
should replace any
<strong>....</strong> by
' .... ' in
$s, and set
$p to be a copy of the
'....'.
Mind you, this leaves as an exercise:
- how you read stuff into $s
- if reading line by line, how to deal with <strong>....</strong> sections that span one or more lines
- in any event, how to deal with pesky CRLF sequences, if there are any
- whether changing foo<strong>FOO</strong>bar to foo FOO bar is really what you want -- that is, do you want to introduce space(s) where there were none before ?
- how any nested <strong>..</strong> sections are to be handled -- which the fragment above fails on, utterly
Some, or all, of which may be dealt with by biting the bullet and parsing the thing.