Sort:  

Forget the full bugged by side effects regex and use toLowerCase()

var str = "Hello World!";
var res = str.toLowerCase();