in reply to A regex question with 2 pieces of data
If your string could be long, then use some parser that does not slurp.use XML::Simple; use Data::Dumper; use strict; my $parser = new XML::Simple(); my $ref = $parser->XMLin("<xml>".'<span class="style">28.56</span><spa +n class="style">-1.22</span><span class="style">-4.1</span><span clas +s="style">04/02</span>'."</xml>"); print $ref->{span}[0]{content}, "\n"; print $ref->{span}[1]{content};
|
|---|