I need to determine the length of string which may contain html-entities.
For example \"&darr ;\" (↓) would return length 6, which is correct, but I want these
You could for most purposes assume that an ampersand followed by letters, or a possible '#' and numbers, followed by a semicolon, is one character.
var strlen=string.replace(/?[a-zA-Z0-9]+;/g,' ').length;