public static int stringMatch(String str, String match) {
		if (match == null || match.length() == 0)
			return 0;
		
		int[] table = KMPStringMatch.buildPrefixTable(match);
		
		for (int i = 0, j = 0; i < str.length();) {
			if (str.charAt(i) == match.charAt(j)) {
				if (j == match.length() - 1)
					return i - j;
				i++;
				j++;
			} else if (j > 0) {
				j = table[j - 1];
			}
			else 
				i++;
		}
		
		return -1;
	}