in reply to regular expression help
Which appears to do the job.my @info; while(<DATA>) { chomp; s< ^ N \d+ \s+ >()x; if(m< ^ \* >x) { push @info => '!' . substr($_, 1); } else { push @info => m< [XYZ] ( [\d.-] +) >gx; } } print "@info\n"; __DATA__ N38 * TOOL 11: 0.125 DIA. FINISH ENDMILL N39 M6T11 N40 E1 N41 S15000M3M7 N42 G17G90G0G8X-5.58Y-18. N43 Z0.05H11 N44 G82G98X-5.58Y-18.Z-0.2R+0.01P50F100. N45 X-3.171 N46 X-1.025 N47 X0.887 N48 X3.371Y-18.688 N49 Y-17.312 N50 X5.46Y-18.
_________
broquaint
|
|---|