I have a regex that breaks a string into an array in each space and stores the value of the space in each case as follows:
var str = "[This is a test]";
var foo = str.toLowerCase().split(/(\S+\s+)/).filter(function(n) {return n});
This returns the following in all modern browsers:
["[This ", "is ", "a ", "test]"];
But on IE8, all I get is ["test]"];
IE8 doesn't seem to read the regex character \Scorrectly. Does anyone know of a workaround for IE8 to play the correct array?
thank
source
share