in reply to REGEX issue
You need to do more test by yourself thought.my $str = <<END_STRING; <story> <page> <description> desc </description> <image> notExpected.jpg </image> <headline> head </headline> </page> </story> <image>correctImage.jpg</image> END_STRING my $ptn = qr{<story>.*?</story>|<image>(.*?)</image>}s; my @out = ($str =~ /$ptn/g); print qq("$_"\n) for grep $_, @out;
|
|---|