Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2023-11-09 20:11
Flavor·ECMAScript (JavaScript)

/
(?<Full_URL>(?<PREFIX>(?:http(?:s){0,1}:\/\/){0,1}(?:w{0,3}\.){0,1})(?<WEBPAGE>[a-z0-9\w-]+(?<DOMAIN>\.[a-z\.]+)\/{0,1})(?<SUBPAGES>[a-z0-9\/@\w]+)?)
/
gi
Open regex in editor

Description

Allows to extract or check if the text includes different URLs, allowing for you to check different kinds of links from the simple ones up to the more complex ones that includes prefix, subdomain, domain, entire website name and subpages.

Submitted by kyunishya