Are there any differences between the two?
replace(/[^a-z0-9]/gi, ''); replace(/[^a-zA-Z0-9]/g, '');
In addition, are there any significant differences in time using this or that?
edit: about performance, I did some testing http://jsperf.com/myregexp-test
No, at first iin the end it makes the case insensitive, which does not matter if the letter it finds is upper or lower case.
i
, , . , .