|
Hi I am trying to break up a string in the form:
test1 test2 "test3 test4" test5 'test6 test7' test8
into an array in the form:
tags[0] = test1
tags[1] = test2
tags[2] = test3 test4
tags[3] = test5
tags[4] = test6 test7
tags[5] = test8
I am using the regex /'([^']*)'|"([^"]*)"|([^\s| ]+)/
If i run this through expresso it gives me the correct results but in javascript using the split method:
var test = "test1 test2 \"test3 test4\" test5 'test6 test7' test8";
var tags = test.split(/'([^']*)'|"([^"]*)"|([^\s| ]+)/);
I get no results!
Any ideas what I am doing wrong?
Thanks
v
|