You could try this in JavaScript. It basically gets the symbols by excluding every character possible in English. I might've forgotten some character and it may not work with other languages that have extra special characters but give it try. I'm using jQuery's $.trim
function for brevity but you could also use "How do I trim a string in javascript?".
Demo: http://jsbin.com/otusuv/7/edit
var str = 'The last Olympics 隶草 was held in 北京';
var words = '', symbols = '';
str.replace(/([\w\s]*)([^\w;,.'"{}\[\]+_)(*&\^%$#@!~\/?]*)/g, function(a,b,c) {
words += b;
symbols += c;
});
words = $.trim(words).split(' ');
symbols = symbols.replace(' ', '').split('');
var total_words = words.length + symbols.length
You may also want to try XRegExp. It's a JavaScript library that enhances regex and has some nice features.