Java tutorial
//package com.java2s; public class Main { public static int getWordCountRegex(String s) { String t = s.replaceAll("[^\\x00-\\xff]", "**"); int length = t.length(); return length; } }