I have a large list (100,000+) of URLS with parameters like so:


I'm using VIM need a regex to replace all values with whatever I desire, like so:


Also, I'm not limited to a Regex, if someone has a solution using norm or sed, that would also work. I just need to be able to automate it.

  • 1
    – Quasímodo
    Commented Dec 14, 2022 at 1:22
  • 1
    That works, just need the %s. You should've answered traditionally so I could mark it answered! Thank you so much though!
    – ex7lted
    Commented Dec 14, 2022 at 4:06
  • @Quasímodo agreed; this could be an answer
    – D. Ben Knoble
    Commented Dec 15, 2022 at 16:02

1 Answer 1


Quasimodo commented the solution, so I'll post here so I can mark this answered:

To replace each value between = and &, and everything after the final =, if it's the last parameter in a URL, for every line in a file, this works:

  • You meant \1replacement
    – Quasímodo
    Commented Dec 31, 2022 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.