Core: Use charAt instead of array notation on strings, to support IE8(?)

Closes #1067
Additionals: fix typo, simplify regex

Closes #1066