I want a regex solution to allow only
http://www.imdb.com/title/ttANYNumberWOrdetc/ links
Otherwise SHOW us error.. Incorrect link
I am not too good with regex
I just create this petren ..
preg_match('/http:\/\/www.imdb.com\/title\/(.*)\//is', 'http://www.imdb.com/title/tt0087469/', $result);
Its show me corect result but i think i missed some thing..
Thanks,
How about something like this:
http://(?:www\.)?imdb.com/title/tt[^/]+/.Example:
Explanation:
The regular expression matches a string that starts with
http://followed either byimdb.comorwww.imdb.com, then/title/ttfollowed by any character except for a/and that ends with a/.The
#is the delimiter, the^indicated the beginning of the string and the$the end.