Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
154
rated 0 times [  156] [ 2]  / answers: 1 / hits: 30149  / 14 Years ago, wed, may 12, 2010, 12:00:00
var str = 'single words fixed string of words';
var astr = str.split( ); // need fix


I would like the array to be like this:



var astr = [single, words, fixed string of words];

More From » regex

 Answers
59
str.match(/w+|[^]+/g)

//single, words, fixed string of words

[#96809] Sunday, May 9, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
isham

Total Points: 69
Total Questions: 86
Total Answers: 86

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
;