P
Paul Hanchett
Why does this:
text= "AA<X>BB<X>CC</X>DD</X>EE"
regex = %r{(.*)<X>(.*)}
t = text.sub( regex, "z" );
print "$1=#{$1}\n$2=#{$2}\n$3=#{$3}\n$4=#{$4}\n"
Return this:
$1=AA<X>BB
$2=CC</X>DD</X>EE
$3=
$4=
Instead of:
$1=AA
$2=BB<X>CC</X>DD</X>EE
$3=
$4=
And how would I fix it?
Paul
text= "AA<X>BB<X>CC</X>DD</X>EE"
regex = %r{(.*)<X>(.*)}
t = text.sub( regex, "z" );
print "$1=#{$1}\n$2=#{$2}\n$3=#{$3}\n$4=#{$4}\n"
Return this:
$1=AA<X>BB
$2=CC</X>DD</X>EE
$3=
$4=
Instead of:
$1=AA
$2=BB<X>CC</X>DD</X>EE
$3=
$4=
And how would I fix it?
Paul