use warnings; use strict; my $str = <Figure 1. Like all other cells in the body, it has a nucleus that contains genetic information.Figure 2. The cell is covered by a membrane and is filled with a fluid. TXT $str =~ s/ # tag including figure number (.*?) # element contents <\/figr> # close tag / "$2<\/FIGIND>" # remainder of element /gmsxe; # Global, multi-line, ignore newline, ignore whitespace, evaluate print $str;