I have this url
http://nikerunning.nike.com/nikeplus/v2/services/app/run_list.jsp?userID=1413795052&startIndex=0&endIndex=-1&filterBy=all
I want to fetch 1413795052 number using regex in javascript, how can I achieve this?
1413795052
Try with:
var input = "http://nikerunning.nike.com/nikeplus/v2/services/app/run_list.jsp?userID=1413795052&startIndex=0&endIndex=-1&filterBy=all"; var id = parseInt( input.match(/userID=(\d+)/)[1] );