Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
^((http:\/\/)?(((([\w\d]|[\w\d][\w\d\-]*[\w\d])\.)*((\w|\w[\w\d\-]*[\w\d]))*(\:\d+)+?)(\/[\w\;\:\@\&\=]*[\/[\w\;\:\@\&\=]*]*(\?[\w\;\:\@\&\=]*)?)))$
"
m

Description

This regex represents the httpurl in BNF from rfc1738 (at topic 5). Reference:https://www.ietf.org/rfc/rfc1738.txt

Submitted by Migueh - 9 years ago