关于Pattern.matcher(name).matches();的有关问题

关于Pattern.matcher(name).matches()的问题。Pattern.matcher(name).matches()报这样的错误,can tmakeas

关于Pattern.matcher(name).matches();的问题。
Pattern.matcher(name).matches();报这样的错误,can 't   make   a   static   reference   to   the   non-static   method   matcher(charsequerence)   from   the   type   Pattern.请高手指点我一下。急,谢谢!

[解决办法]
正则的用法:
Pattern pattern = Pattern.compile(...);
Matcher m = pattern.matcher(...);
[解决办法]
import java.util.regex.*;

class Regex1{

public static void main(String args[]) {

String str= "For my money, the important thing "+

"about the meeting was bridge-building ";

String regEx= "a|f "; //表示a或f

Pattern p=Pattern.compile(regEx);

Matcher m=p.matcher(str);

boolean result=m.find();

System.out.println(result);

}

}