Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-04-16 04:50
Flavor·PCRE (Legacy)

/
^https?:\/\/(.*:.*@)?[^\.:]+(\.[^\.:]+){1,2}(\:\d+)?[^:]+$
/
gm
Open regex in editor

Description

Basic enforcing of URL minimal structure, without being too strict.

Supports:

user:pass@ domain.com:80

Bugs:

I worked it out quickly; can't guarantee it works in all cases. Please test with wider range of cases, and report bugs if you find them.

Submitted by anonymous