📅  最后修改于: 2022-03-11 14:52:19.735000             🧑  作者: Mango
import java.util.regex.Pattern;
public class PatternMatchesExample {
public static void main(String[] args) {
String text =
"This is the text to be searched " +
"for occurrences of the pattern.";
String pattern = ".*is.*";
boolean matches = Pattern.matches(pattern, text);
System.out.println("matches = " + matches);
}
}