https://.mobile.twitter.com/Shareblue/status/842491578191110146?ref_src=twsrc%5Etfw
Is that even a valid URL? But yes, that'd be very easy to do. See line 19 in 0.0.2.
$message = preg_replace_callback('~<a href="(http[s]?://twitter.com/\w+/status/\d+)" (.*?)>\1</a>~',
I can't be bothered to look up the specific PHP regex syntax atm, but the basic idea would be something like this:
(http[s]?://(\.?mobile\.)?twitter.com/\w+/status/\d+(\?.*)?)
Edit: Or more concretely as part of the whole, like this:
$message = preg_replace_callback('~<a href="(http[s]?://(\.?mobile\.)?twitter.com/\w+/status/\d+(\?.*)?)" (.*?)>\1</a>~',
You should probably replace that greedy .* with something slightly safer, for example:
\?ref_src=[\w%]+
However, I don't know enough about that ref_src thing to tell.
Also you would need to make those groups non-matching with (?:blabla) or whichever syntax applies, or otherwise name your actually relevant groups. Sorry, that quick drive-by is all I have time for.