Regular Expressions 101

Community Library Entry

3

Regular Expression
Python

r"
(^http(s)?://)?((www|en-es|en-gb|secure|beta|ro|www-origin|en-ca|fr-ca|lt|zh-tw|he|id|ca|mk|lv|ma|tl|hi|ar|bg|vi|th)\.)?twitch.tv/(?!directory|p|user/legal|admin|login|signup|jobs)(?P<channel>\w+)
"
gm

Description

Can grab all kinds of valid twitch URLs.

Submitted by Mio - 10 years ago