Regex does the trick! It can probably be less greedy but it works quite nicely.
# Prevent Internet sites from requesting LAN resources. Site LOCAL Accept from LOCAL Accept GET from git.mydomain.com ^http.:\/\/slack-redir\.net\/link\?url=https\%3A\%2F%2Fgit\.mydomain\.com.*$ Deny