ArrayList<String> (String str) { ArrayList<String> res = new ArrayList<>(); StringBuilder sb = new StringBuilder(); Matcher matcher = PATTERN.matcher(str); while (matcher.find()) { res.add(StringUtil.toLowerCase(matcher.group())); sb.append(matcher.group()); } if (!isIdentifier(sb.toString())) { res.clear(); } return res; }