I'm new to RegEx, trying to learn all the ins and outs... In this case, I'm extracting the feedrates from a G-code file, and I want to take the existing value (ie: F10.0 means a speed of ten inches per minute) and multiply it by some factor. This would be easy with normal variables, but I can't seem to do anything useful with the backreferences ($0, $1, etc) except treat it as a string. So in this example, instead of turning F10.0 into <F10.0> as shown, I want to turn it into F14.0
Code: Select all
FeedrateOverride:
Override := 1.40
string := "G0G90X1.2Y3.4F10.0M8"
result := RegExReplace(string,"(?:F)([\-\d\.]+)", "<F$1>" ) ;"F" . ("$1")*Override doesn't work, Func($1) doesn't either
MsgBox, %result%
Return
- Joel