Ive been battling with this for a while and would appreciate a tip! I'm stripping certain elements from a Gcode file before sending it to a 3d printer
My string is
f100G00X345.234Y234F345.5623I-2344.234J234.234F544
or similar and I watch to match (with a view to removing) the elements where the letter 'F|f' is followed by a number (float), in the string above these are:
f100 - F345.5623 - F544
My regex that is very close sofar is
(F|f).*?([^0-9|.]|\Z)
http://rubular.com/r/4GFziqlcR6
which I think (not sure) finds the F letter, and grabs everything which is either number or dot or end of sting. BUT this also includes the last character and in the sting above matches
f100G - F345.5623I - F544
So, how do I either ditch the last character form the matches or what would be a better approach.
thanks