Regular Expressions 101

Library entries

Capture only top-level (root) domain in URL

Vote

3

Regular Expression
pcre

/
^(?:(?:http[s]?|ftp):\/)?\/?(?:[^:\/\s]+?\.)*([^:\/\s]+\.[^:\/\s]+)
/

Description

Loading markdown...
Submitted by guyfawkes - 7 years ago