question: 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 ( ) ; }
target:  Return true if find ",member," | ",member$" | "^member," | "^member$"