http://m.facebook.com/messages/1245/abc
http://m.facebook.com/messages/12/
http://m.facebook.com/messages/5/
http://m.facebook.com/messages/particular_String/abcd/Trigma
So these are the urls and i would like to fetch the 1245 from first url 12 from second 5 from third and particular_string from fourth.how can i do this?