I have this regex:
var src = button.src.replace(/(\.[^.]+)$/, '_over$1');
so file.gif becomes file_over.gif.
What i dont quite understand is how the file extension is put back in. Im guessing that the $1 at the end stands for the bit after the dot ( the extension) If it does then suppose $0 would give me the start of the filename ( before the dot).
could anyone clarify?