[求助]发现奇怪错误
import java.net.*;
import java.io.*;
import java.util.*;
import java.util.regex.*;
/**
*
* @author hanfeng
*/
public class Hello {
public static void main(String[] args) throws Exception{
Pattern p = Pattern.compile("a*b");
Matcher m = p.matcher("ab");
boolean b = m.matches();
System.out.println(b);
}
}
这段程序我用netBeans运行结果竟是falseimport java.io.*;
import java.util.*;
import java.util.regex.*;
/**
*
* @author hanfeng
*/
public class Hello {
public static void main(String[] args) throws Exception{
Pattern p = Pattern.compile("a*b");
Matcher m = p.matcher("ab");
boolean b = m.matches();
System.out.println(b);
}
}
如果一开始是ture 我把ab改成abb 结果都知道是false 当我再改成ab发现结果竟然是false
谁有空帮我测试一下