This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Replace a string in Klipper

Tags: None
(comma "," separated)
nalbrecht
Registered Member
Posts
4
Karma
0

Replace a string in Klipper

Fri Feb 15, 2019 8:23 am
Hi,

I just discovered that Klipper provides a functionality to process clipboard contents. I'd like to better understand this, so I thought I'd try something easy first: get rid of Amazon ref information when I copy an Amazon link.
Example: Let's say I have a standard Amazon link I copy from a browser, like this:
https://www.amazon.com/Guide-KDE-Other- ... ywords=kde
Using Regex, I can do this in the shell:
Code: Select all
echo ${AMAZONLINK/\/ref=*/}

This results in the link being capped after the product ID, i.e.
https://www.amazon.com/Guide-KDE-Other- ... B00HGW8D3G
How can I do that in Klipper?
I tried the following:
- create a new action using "https://www.amazon.com" (without quotes) as the regex,
- "echo ${%s/\/ref=*/}" as the command and
- "replace clipboard" as the action.
Apparently, this doe not work. Any ideas?
Thanks!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar