//===================================================================================
// Regex tester
// Practice with regex - Change the values of str & regex below
//===================================================================================
import java.util.regex.*;

public class practiceRegex 
{
    public static void main(String[] args) 
    {
        String str   = "Hello World";                   //the string
        String regex = "H.+\\s+.+d";                    //regex (here: test any 2 words starting with H and ending with d) 

//      String regex = "(?i)h.+\\s+.+";                 //any 2 words staring with h - (?i) not case sensitive 
                
        boolean OK = Pattern.matches(regex, str);       //test the string against regex
    
        System.out.println(OK); 
    }       
}