Regular Expressions 101

Community Patterns

Python regular expression to detect any type of group link and private channel in Telegram

2

Regular Expression
Python

r"
(?i)(https\:\/\/){1}((t\.me|telegram\.me)\/){1}(joinchat\/)?(([\+\_\-a-zA-Z0-9])+)$
"
mg

Description

You can use this regular expression to identify any type of Telegram link. It doesn't matter whether it is t.me or telegram.me.

Links including "joinchat" are also accepted.

Submitted by Telegram : T.me/TinyPY - 9 months ago (Last modified 9 months ago)