A
Alex
Why results are different? Why second one can't find pattern?
public static void main(String[] args) {
Pattern pattern = Pattern.compile ("a*\\.process,RUN*");
Matcher matcher = pattern.matcher
("apps_111.process,RUNNING");
System.out.println(matcher.find());// true
Pattern pattern1 = Pattern.compile
("apps*\\.process,RUN*");
Matcher matcher1 =
pattern1.matcher("apps_111.process,RUNNING");
System.out.println(matcher1.find());// false
}
Alex.
public static void main(String[] args) {
Pattern pattern = Pattern.compile ("a*\\.process,RUN*");
Matcher matcher = pattern.matcher
("apps_111.process,RUNNING");
System.out.println(matcher.find());// true
Pattern pattern1 = Pattern.compile
("apps*\\.process,RUN*");
Matcher matcher1 =
pattern1.matcher("apps_111.process,RUNNING");
System.out.println(matcher1.find());// false
}
Alex.