Regular Expressions 101

Community Patterns

1...34567...901

Community Library Entry

0

Regular Expression
Python

r"
((?#1)((?#2:protocol)\w+)://)((?#3:hostname)[\w\.]+)((?#4:path).+|$)
"
gm

Description

source = "https://regex101.com/r/Y5b7zZ/3"
result = ("https", "regex101.com", "/r/Y5b7zZ/3")
Submitted by saparapat - 2 years ago