fork download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. class Program {
  5. public static void main(String[] args) throws Exception {
  6. Matcher fonte = (Pattern.compile("test")).matcher("teste de regex");
  7. System.out.println(fonte.find());
  8. System.out.println(fonte.matches());
  9. }
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/242446/101
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
true
false