I get false checking "AA8187517"
string by the regex:
if (/^[a-z0-9]*$/i.test(value))
What I suddenly see in the console?
> value.split('').filter(function(el){ return el != '' })
< (11) ["", "A", "A", "8", "1", "8", "7", "5", "", "1", "7"]
What are these two values in the array?
The two "empty" values in your array contain character 8207 (decimal), which is 200f (hex).
U+200F is RIGHT-TO-LEFT MARK in Unicode, an (invisible) marker that changes the direction text is displayed.
Here's a reproduction of your issue plus sample code to remove the character: