I have some random string, for example: Hello, my name is john.. I want that string split into an array like this: Hello, ,, , my, name, is, john, .,. I tried str.split(/[^\w\s]|_/g), but it does not seem to work. Any ideas?
I have some random string, for example: Hello, my name is john. . I
Share
Try this (I’m not sure if this is what you wanted):
http://jsfiddle.net/zNHJW/3/