Regular Expressions 101

Community Patterns

1...45678...902

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

~
(?<scheme>[^!$&'()*,;=@//:\s]+):(?<authority>//(?<userinfo>(?<username>[\w\.\-!$&'()*,;=]+):?(?<password>[\w\.\-!$&'()*,;=]+)?@)?(?<host>[^\s\n\t\r/:\[\]]+|\[[^\s\n\t\r/:\[\]]+\]):?(?<port>\d{1,5})?)?[/]?(?<path>[^\s\?#]{1,}(?:\?(?<query>[^\s#]+))?(?:#(?<fragment>[^\s]+))?)?
~
g

Description

A fully? complete Uniform Resource Identifier/Locator parser for all your need.

it should support theses flavors with some changes or by using a different delimiter: PRCE2/PRCE, ECMAscript and should be able to support RUST, JAVA, GOLANG, .NET flavors with ease. for PYTHON, I don't really know.

Submitted by fbd_1 - 25 days ago (Last modified 20 days ago)