I have a bunch of urls like these.
$urls = array( \'https://site1.com\', \'https://www.site2.com\', \'http://www.site3.com\', \'https://sit
/^(https?:\/\/)?(www\.)?(.*)\/$/i
And use what's on $3. Or, even better, change the first two parentheses to the non-capturing version (?:) and use what's on 1.
$3
(?:)