import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String s = "This is a test() function";
		String s2 = "This is a test    () function";
		String s3 = "test() function";
		System.out.println(s.matches(".*(?<!\\S)test\\h*\\(.*"));
		System.out.println(s2.matches(".*(?<!\\S)test\\h*\\(.*"));
		System.out.println(s3.matches(".*(?<!\\S)test\\h*\\(.*"));
	}
}