Help with regex
i need a help in regular exp, iam trying to find if two strings have all,some or not at all, common letters, if some of the letters are same, create as a new string, eg, str1="acyq" and str2="zyapkf"; i tried this but not getting neaar what i wanted, can someone give me examples even in other way to solve.
public String findSimilarity(String str){
String regvar=null;
String reg="[tap3]+";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(str);
while(matcher.find()){
regvar =matcher.group();
}
return regvar;
}

