Try:
public static void main (String[]args)
{
String text =
"This is the text to be searched 45" +
"for occurrences of the pattern.";
String pattern = "(.*)searched(.*)";
boolean matches = Pattern.matches (pattern, text);
System.out.println ("matches = " + matches);
}