Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-05-05 11:47
Flavor·Python

r"
^https?:\/\/[A-Za-z0-9:.]*([\/]{1}.*\/?)$
"
Open regex in editor

Description

extract the path from a URL returns one group (if matching) with the path info e.g. http://somedomain.com/some-page/ http://www.domain.com:8080/some-page/ https://www.google.com:8080/some-page/ all return /some-page/

Submitted by luke_aus