import java.util.regex.*; class RegEx { public static void main ( String[] args ) { String data = "how are we doing today"; Pattern p = Pattern.compile("(.)e"); Matcher m = p.matcher( data ); if (m.find() ) // Must use matches or find or lookingAt before checking results System.out.println( data + ": " + m.group(1) ); } }