I want to define something like
\newcommand{\myhref}[2]{\href{#1}{do something with #1}}
and then paste URLs from the web into \myhref{...}{hello}.
The special characters in URLs mean that this works only if I fix up every URL (usually by preceding special characters with a \ ). It would be much more pleasant if I could tell myhref to inherit the rules of treating urls in argument #1 just-as-if-pass-verbatim from/to href.
the question is closely related to Problem with use of '#' in custom \href command . However, I need a more general solution. Unfortunately, URLs cannot just contain # , but _ and & and probably a few more special characters. Is there a more general solution?