Hi very new to regular expression, i have the following js function to return the number of words displayed in a text area.
var matches = textarea.replace(/<[^<|>]+?>| /gi,' ').match(/\b/g);
var count = 0;
count = matches.length/2;
This function works perfectly except when a word is contained in double quotes: eg "word"
This will come back as 3 words, and I need it to be 1
Any help would be much appreciated.
View Complete Post