Hi,

I'm trying to use javascript regexp to find the following.

var url = "";


I need to get 320459852842 from the above url.

This is the regexp i'm using which doesnot get me the result.
var matched = url.match('^http:\/\/.*(?=\/)?([\d]+)*(?=\?|cmd)*/');

Pls Help.

Hi,

I need to get 320459852842 from the above url.

var url = "";
var item = url.match(/\/([^/]+)\?/);
alert(item[1]);

This isolates the item string even if the length varies or it isn't always digits.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.