Use XML parser module; one among some is XML::LibXML.
If you insist, update your regex to account for the value between start & end tags ...
use v5.16.0; my $tag = 'tag'; my $string = '... <tag>value</tag>'; my $parse = qr{<$tag>(?<val>.*?)</$tag>}s; $string =~ $parse and say 'found: ', $+{'val'}
In reply to Re: regex pattern matches
by Anonymous Monk
in thread regex pattern matches
by argos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |