Greetings. There is a line like mysite.com/somepage, mysite.com/anotherpage, ... I want to select from here in the array only the names of the pages on mysite.com, that is, somepage and anotherpage . I use the following regular expression:
/(?:mysite\.com)(?:\/\S*)?/ How can I make sure that mysite.com in front of the page name, but do not include mysite.com in the result? When i do
preg_match_all("/(?:mysite\.com)(?:\/\S*)?/", $str, $res); At the output I get an array along with the domain. Although, in theory, ?: After all, should exclude the domain from the result. What am I doing wrong?