Import the java.util.regex *. ; class RegexExample1 { public static void main (String args []) { String Content = "noob the I AM" + "from runoob.com." ; String pattern = "* * runoob.." ; Boolean IsMatch = Pattern.matches (pattern, Content); System.out.println ( "contains the string 'runoob' substring?" + IsMatch); } }
updating..........