import java.util.ArrayList;
import java.util.List;
import java.util.regex.*;

public class DemoRegEx {
    final public static String regex = "e([a-z]+)ch";
    final public static String input = "h";

    public static void main(String[] args) {
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(input);

        System.out.println("Regular expression: " + p.pattern());
        System.out.println("Input:              " + input);
        System.out.println();


        System.out.println("Matches entire string?");
        System.out.printf("  ⇒ %b\n", m.matches());

        System.out.println("First match:");
        m.find(0);
        System.out.printf("  ⇒ %b\n", m.matches());
    }
}