1

I'd like to modify a backreference in RegExReplace before using it.

I want to make something like this work:

RegExReplace(ManualTimeValues, "(\d+)\.(\d+)", "$1"*60+"$2")

ManualTimeValues is a line containing numbers in integer and floating point format, separated by spaces. I want to replace the floating point numbers with integers computed by multiplying the part before the point with 60 and adding the part after the point.
I've also tried :

RegExReplace(ManualTimeValues, "\d+\.\d+", min2sec("$0"))

with min2sec being a custom function that converts a single floating point number.
I've also tried the same lines with unquoted backreferences.

I've solved this in practice using

Loop, Parse, ManualTimevalues, %A_Space%

but is there a way to use RegExReplace for this?

4

1 回答 1

0

如果您使用 AutoHotkey_L(如果您不使用,则应该使用),请在索引中搜索“Regular Expression Callouts”。这将允许您做您正在寻找的事情,尽管您的循环解析在这种情况下同样出色。

于 2013-01-27T05:58:05.927 回答