private int isSpecialCaseMatched(State altLink, State current,
			char[] targetStr, int offset) {
		while (((altLink.getCh() == targetStr[offset]) || (altLink.getCh() == State.ANY && (current == null || ((offset < targetStr.length) && (targetStr[offset] != current
				.getCh()))))) && (++offset < targetStr.length)) {
			// checking for join state. if it is there then stopping loop.
			// this case is useful for '?' char
			if (altLink.getOut() != null
					&& altLink.getOut().getCh() == State.JOIN) {
				break;
			}
		}
		return offset;
	}