خرید بک لینک

Vote count: 0

Asuming I have something like

var url = 'http://stackoverflow.com/questions/24a34b83c72/js-regex-get-values-between-two-characters'

How could I get the 24a34b83c72 ID using pure javascript? I know that it's always after the questions/ part and that regardless if it contains a number or symbol, it needs to end before the next /. I tried things like;

url.substring(url.lastIndexOf('details/'))

But that resulted in the entire thread after it. I tried regular expresions but the closest I got to is:

var regex = /"details/"[a-zA-Z0-9]+"/"/

Can anyone help me?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 20 فروردين 1395 ساعت: 6:21

صفحه بندی