uBlock - rewrite href text

Lets say I have the following link on some page

<a href="https://example.com/string?param1=1&param2=2">Title</a>

And using uBlock I'd like to rewrite it to:

<a href="https://example.com/string">Title</a>

I've found some Adblock Plus article and the documentation which seems like what I need.

I'm not sure if uBlock supports that syntax. I'm trying the following rule:

(example.com/string/)(\?.+)$rewrite=$1

But $1 is marked as error by uBlock editor, same as this example from Adblock Plus article:

/(^https?:\/\/example\.com\/page-123\.php)\?.*/$rewrite=$1

This may be a feature of Adblock Plus, but it fails to accept these rules too


This feature was discussed, but declined due to security concerns.
https://github.com/uBlockOrigin/uBlock-issues/issues/46

You might wanna have a look at addons that do only this:
https://addons.mozilla.org/de/firefox/addon/requestcontrol/