I have this string for example:
str = \"my name is john#doe oh.yeh\";
the end result I am seeking is this Array:
strArr = [\'my
I would think a combination of split() and replace() is what you are looking for:
str = "my name is john#doe oh.yeh"; strArr = str.replace('\W',' &'); strArr = strArr.split(' ');
That should be close to what you asked for.