Community Patterns

Community Library Entry

2

Regular Expression
Created·2023-07-26 14:47
Flavor·PCRE2 (PHP)

/
^(?:[^:\/?#]+:)?(?:(?:\/\/)?(?:[^\s\/?#]+\.)+[^\s\/?#]+(?:\/[^\s"#]*)?)$
/
gm
Open regex in editor

Description

IDN Domains & Normal Domains This regex is able to identify any type of domain or subdomain whether it is IDN or normal, this includes domains in emojis, non-Latin characters, etc.

Submitted by NCK