Regular Expressions 101

Community Patterns

URL (URI) - TOTAL Breakdown: Named Groups (Supporting Literal, Relative, Dynamic URLs, with/without Filename/Ext, Query Parameters and/or Anchor Tags)

1

Regular Expression
ECMAScript (JavaScript)

/
(?<FULLREQUEST>^(?<HOST>(?<PROTOCOL>(?:http)?s?:?\/\/)(?<DOMAIN>[^\/]+\/)|(?<RELATIVE>(?:\.*\/?)+))(?<PATH>[^\s]+\/)?(?<FILENAME>(?:(?<NAME>[^\/\s\.\?\#]+?)?(?<EXT>\.[^\s\?\#]*)?|(?:\/[^\/\s\?\#]+?)))(?<QUERYSTRING>\?[^\s\#]+)?(?<ANCHOR>\#\S+)?$)
/
gim

Description

Loading markdown...
Submitted by @JJ for Nerdy Deeds, LLC - 3 months ago
(Last modified 3 months ago)