vendredi 31 juillet 2015

javascript regular expression for -999x999

I need a regular expression for:

-[n digits]x[n digits]

I already tried this:

var s = "path/path/name-799x1024.jpg"; 
s.replace(/\d/g, "");

But this gets only the digits. Here is a small jsfiddle: http://ift.tt/1LYqYlr

The outcome I try to get is:

pfad/pfade/name.jpg

How do I add the - and the small x between the two digits?

Aucun commentaire:

Enregistrer un commentaire