Click to See Complete Forum and Search --> : [RESOLVED] [Ask]Identify Image


silva
05-25-2010, 09:53 PM
how to identify image from folder with javascript .. after identify i want to separate file name . example :
1001-001-Black

i want to separate these name to 3 different variable.
i'm using asp vb.net to implement.


thanks for advance:)

letmehaveago
05-25-2010, 10:14 PM
Javascript is not able to access the file system. It must be given the filename!

For the separation you need regular expression as shown:


var filename = "1001-001-Black";
var pattern = /(\d+)-(\d+)-(\w+)/;
var matches = filename.match(pattern);
alert(matches);

silva
05-25-2010, 11:12 PM
thanks for quick advance letmehaveago :)