import java.util.regex.Matcher;
import java.util.regex.Pattern;

class Ideone
{
	public static void main(String[] args) {
		String haystack[] = {"Ahmet Yıldırım", "Esin AYDEMİR"};
		String needle[] = {"yildirim", "aydemir"};
		for (int i = 0; i < haystack.length; i++) {
			System.out.println(find(haystack[i], needle[i]));
		}
	
	}
	
	public static boolean find(String haystack, String needle) {
		Pattern p = Pattern.compile(needle, Pattern.LITERAL | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
		Matcher m = p.matcher(haystack);
		if (m.find()) {
			System.out.println(m.group());
			return true;
		} else {
			return false;
		}
		
	}
}
