Reset URL before Copying to clipboard?

Hey guys, I’m using the Copy to clipboard plugin, which is quite simple and usefull, but there’s a miner issue.
Captura de tela de 2022-10-19 11-43-06
When the user already has used the function in that session, the parameter sticks with the user. So, when he uses it again, he will have 2 parameters ID’s in the copied URL, creating something like

I’ve tried using the ? fixed rule, but it dosn’t work. Trying to figure something around find & replace, or a way to reset the URL before copying it, but nothing. I feel quite dumb not knowing a way around this, but I figure it’s a common issue. Did you already go through this?

The way you will do this is by using Regex

Here is a really good guide on how to write regular expressions (Regex)

Using the :find&replace function will allow you to match with a regex pattern, and then replace it with nothing (a blank space).

Regex looks scary but it’s actually not that bad. Also, learning regex will make you a much better developer and will make you stand out from the rest.


1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.