note
siva kumar
If you want to do this with regex, you can use the following code.
<code>
$line = "{chart {{1 {{title title_1} {xlable X-lab} {ylable Y-lab} {description desc1} {type line} {series {{1 {{x_data {1 2 3 4 5}} {y_data {20 90 60 50 30}}}}}}}}}}";
$line =~ /x_data\s+\{(.*?)\}/;
print "X DATA : $1 \n";
$line =~ /y_data\s+\{(.*?)\}/;
print "Y DATA : $1 \n";
</code>
UPDATE:
Enclose the matching expression within if block.
<code>
if ($line =~ /x_data\s+\{(.*?)\}/) {
print "X DATA : $1 \n";
}
if ($line =~ /y_data\s+\{(.*?)\}/) {
print "Y DATA : $1 \n";
}
</code>
604499
604499