Case insensitive regex in JavaScript
modifiers are given as the second parameter:
new RegExp('[\\?&]' + name + '=([^&#]*)', "i")
You can add 'i' modifier that means "ignore case"
var results = new RegExp('[\\?&]' + name + '=([^&#]*)', 'i').exec(window.location.href);