code: public int getCharCount(String text) {
          String result = text.trim();
          Matcher matcher = HTML_TAGS.matcher(result);
          result = matcher.replaceAll("");
          return result.length();
      }
docs: Get the character count of the given text excluding any HTML tags. This
  will first strip any HTML tags from the given string and then return the
  number of characters in the result. For example, the input string
  <code>&lt;em&gt;Hello&lt;/em&gt; World</code> would return 11 characters
  as the <code>em</code> tags would be stripped.
  
  @param text The text to evaluate
  
  @return The number of characters in the string excluding HTML tags