使用 RegEx 提取字串部分
myDebt := 9000
index := RegExMatch("You owe me $42", "\$(\d+)", dollars)
if(index > 0) { ; indices are usually 1-based in AHK
myDebt += dollars1
MsgBox, Current debt: %myDebt%
}
結果:
目前的債務:9042
myDebt := 9000
index := RegExMatch("You owe me $42", "\$(\d+)", dollars)
if(index > 0) { ; indices are usually 1-based in AHK
myDebt += dollars1
MsgBox, Current debt: %myDebt%
}
結果:
目前的債務:9042