I'd like to parse the URL part after TLD. In another words I'm interested in the bold part http://bytes.com/submit/304/ of this URL.
Let's assume that all the URLs are valid and formally flawless.
It seems to me one way is to make a regular expression like this: "anything, dot, 2 to 4 letters, slash, anything". The Regexp might look like this:
Is my thinking correct or am I overlooking something?
Let's assume that all the URLs are valid and formally flawless.
It seems to me one way is to make a regular expression like this: "anything, dot, 2 to 4 letters, slash, anything". The Regexp might look like this:
Code:
$regexp = '@.+\.[a-z]{2,4}\/(.+)@si';
Comment