How to extract only the numbers from the clipboard?

From the Clipboard "12-31 22 Text abc" I would like to extract ONLY the numbers.
No Spaces, no text or letter letters in the end result.
Goal =
Extract resulting in:
123122

Regex search the clipboard for anything that isn't a digit and replace it with nothing:

Extract Numbers from Clipboard.kmmacros (1.2 KB)
image

2 Likes

Thanks! Any way of keeping the commas?
Lets say for the clipboard containing "20.000,01 text_Ta bc"? and then return
"20.000,01" in the clipboard?

Actually to remove the dots, but keep the comma!
That is my next goal.

No problem. To be clear, you'd want the result to be "20000,01", yes? In that case, you just search for everything that isn't a digit or a comma:

Extract Numbers from Clipboard.kmmacros (1.2 KB)
image

1 Like

Thanks man! :smiley: !

1 Like