Fixed group expanding in IE7 (#369) - string[i] syntax doesn't work in IE, use string.charAt(i) instead