fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String s = "This is a test() function";
  10. String s2 = "This is a test () function";
  11. String s3 = "test() function";
  12. System.out.println(s.matches(".*(?<!\\S)test\\h*\\(.*"));
  13. System.out.println(s2.matches(".*(?<!\\S)test\\h*\\(.*"));
  14. System.out.println(s3.matches(".*(?<!\\S)test\\h*\\(.*"));
  15. }
  16. }
Success #stdin #stdout 0.07s 33968KB
stdin
Standard input is empty
stdout
true
true
true