Page 1 of 1

Filter clipboard to numbers only

Posted: 27 Mar 2018, 06:21
by SvenBent
I have a little utiltiy that copy paste some stuff for me but I want it to be able to filter the text into only numbers

Code: Select all

^+c::
v_ClipSaved := ClipboardAll
Sleep 99
Send ^c
Sleep 99
Winactivate Bria 4
Sleep 99
send ^v
Sleep 99
Clipboard := v_ClipSaved
send {enter}
return
If I copy something like "(123) 456 -7890" I want it to filter it into "1234567890"
Is there an easy filtering method/command ?

Re: Filter clipboard to numbers only

Posted: 27 Mar 2018, 06:25
by BoBo
Loop, Parse, ... :?:

Re: Filter clipboard to numbers only  Topic is solved

Posted: 27 Mar 2018, 06:50
by Guest

Code: Select all

MsgBox % RegExReplace("(123) 456 -7890","[^\d]")
:?:

Re: Filter clipboard to numbers only

Posted: 27 Mar 2018, 06:52
by BoBo
Gast wrote:

Code: Select all

MsgBox % RegExReplace("(123) 456 -7890","[^\d]")
:?:
Is there an easy filtering method/command ?
:shh: :mrgreen:

Re: Filter clipboard to numbers only

Posted: 27 Mar 2018, 07:10
by Guest
BoBo wrote::mrgreen:
:lol:

Re: Filter clipboard to numbers only

Posted: 27 Mar 2018, 07:46
by SvenBent
Guest wrote:

Code: Select all

MsgBox % RegExReplace("(123) 456 -7890","[^\d]")
:?:
This was awesome and seems to be a very powerfull command/tool thank you.