if ($line =~ /x_data\s+\{(.*?)\}/) { print "X DATA : $1 \n"; } if ($line =~ /y_data\s+\{(.*?)\}/) { print "Y DATA : $1 \n"; }