HI,

I have this regex:

Code JavaScript:
 var src = button.src.replace(/(\.[^.]+)$/, '_over$1');


Now i know what it does and how some of it works....ive done a bit of regex in php and its almost the same in javascript i think. Basically its finding the period(.) in the file and adding, before the period, the letters _over. Its then putting the file extension back in. If someone could spell the regex out for me that would be great! I think its saying replace a 1 or more dots with this.....

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?