private static boolean contains(String group,String member){
  String quote=Pattern.quote(member);
  Pattern pattern=Pattern.compile("," + quote + "$|^"+ quote+ ",|^"+ quote+ "$"+ "|,"+ quote+ ",");
  Matcher matcher=pattern.matcher(group);
  return matcher.find();
}

private static boolean contains ( String group , String member ) { String quote = Pattern . quote ( member ) ; Pattern pattern = Pattern . compile ( "," + quote + "$|^" + quote + ",|^" + quote + "$" + "|," + quote + "," ) ; Matcher matcher = pattern . matcher ( group ) ; return matcher . find ( ) ; }
return true if find " , member , " | " , member $ " | " ^ member , " | " ^ member $ "
