boolean res = pat.matcher("aaab").matches();