I have a thousands of URL's that I need to check and explode into separate variables.
The url's I'm searching for look like this:-
http://www.mydomain.com/facebook-pages/252090964881271-smirnoff
http://www.mydomain.com/facebook-pages/3312880235580-facebook-for-every-phone
http://www.mydomain.com/facebook-pages/2449443856-candy-crush-saga
Others I want to ignore do not have numbers in them like this:-
http://www.mydomain.com/facebook-pages/media/
I need a regex pattern that can identify strings that begin with:-
http://www.mydomain.com/facebook-pages/ and ALSO contain a series of numbers (of variable length).
I then need to extract the code (the numbers) and the text after the numbers, for example:-
$pagecode = "2449443856
$pagename = "candy crush saga"
from this string http://www.mydomain.com/facebook-pages/2449443856-candy-crush-saga
I have tried all different regex strings and I'm really struggling. Can anyone help please?
Thanks
Jonathan