Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:https?:\/\/)?(?:www\.)?[\d\w\.-]+(?:\.|:)(?:[a-z\.]{2,6}|\d+)\/?.*$
/
gmi

Description

Matches most of the URLs I through at it. Did not find any ULR that it doesn't match yet.

Submitted by Dashrath Sharma - a year ago