String regex = "\\w+"; // 「\w+」 String text = "Mastering Regular Expressions"; Matcher m = Pattern.compile(regex).matcher(text); if (m.find()) System.out.println("match [" + m.group() + "]"); ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl