r"
(?:
(?<!\S)@ # Match "@" only if it's not preceded by a non-whitespace character
| # OR
(?:
# Telegram link types reference: https://core.telegram.org/api/links
#
(?:https?://)? # Optional HTTP or HTTPS protocol
(?:www\.)? # www subdomain
(?:t\.me|telegram\.(?:me|dog)) # Match "t.me", "telegram.me", or "telegram.dog" domains