Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(http:\/\/|https:\/\/)?[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*(\.[a-zA-Z0-9]{1,10})((\/+)[^\/ ]*)*
/
gm

Description

I think this is the regex that Twitch uses to determine what is a clickable link on chat.

Submitted by emongev - 3 years ago