I need assistance with RegExReplace in AHK.
I want my script to search text and keep only numbers after $ sign.
Right now I have:
F1::
Clipboard =
SendInput, ^c
ClipWait
Variable := Clipboard
NewVar := RegExReplace(Variable,"[^.0-9]+", "{+}")
send % NewVar
return
For example if text is "unit $400 unit 500 $400" I get 400+500+400+
What I would like to get is "400+400+"
I havent been able to figure out how to exclude numbers that dont have $ and I am not sure RegEx is the best thing to use here.
Any help would be great!
\$(\d+(?:\.\d+)?)would suffice.Pos := 1, =>While Pos { Pos:=RegExMatch( str, "\$(\d+(?:\.\d+)?)", M, Pos+StrLen(M1) ) Match%A_Index% := M1 }- Wiktor Stribiżew