I was checking Regex website and tried to get from this string "Order-number: 123456464-" only number with minus sig → 12345664-
On website its working, but it does not work in AHK.
Could some one give me help with this little challenge?
Code: Select all
; I need assign to variable only value which contains numbers and minus in the end. output: 124546464-
MsgBox % RegExMatch("Kunde-number: 124546464-", "\d+-", OutputVar)
MsgBox % OutputVar
; Also tried
Msgbox,% RegExReplace("Kunde-number: 124546464-", "[^\d]+") ; output: 124546464 but I need minus too -
MsgBox % RegExReplace(("Kunde-number: 124546464-", "[^0-9-]") ; output: -124546464- , but i need only last minus - example 124546464-