Check if given text starts with #REDIRECT, with case ignoring

@param text The text fragment to check. Must not be {@code null}.
@return {@code true} if text starts with #REDIRECT, false otherwise
772573
public static boolean isRedirect(String text) {
		boolean result = false;
		String pattern;
		for (int i = 0; i < redirectPatterns.size() && !result; i++) {
			pattern = redirectPatterns.get(i);
			result = text.regionMatches(true, 0, pattern, 0, pattern.length());
		}
		return result;

	}
175021
public static boolean startWith(@Nullable CharSequence s, char c) {
		if (StringUtils.isEmpty(s)) {
			return false;
		}
		return s.charAt(0) == c;
	}
568381
public boolean matches(String text) {
        if (text == null) {
            return false;
        }
        if (this.regex) {
            final Pattern rx;
            if (this.caseSensitive) {
                rx = Pattern.compile(this.value);
            } else {
                rx = Pattern.compile(this.value, Pattern.CASE_INSENSITIVE);
            }
            return rx.matcher(text).matches();
        } else {
            if (this.caseSensitive) {
                return value.equals(text);
            } else {
                return value.equalsIgnoreCase(text);
            }
        }
    }
991212
private boolean isValid(CharSequence text) {
        for (int i = 0; i < text.length(); i++) {
            char c = text.charAt(i);
            // as defined by http://www.w3.org/TR/REC-xml/#charsets.
            boolean valid = c == 0x9 || c == 0xA || c == 0xD
                    || (c >= 0x20 && c <= 0xd7ff)
                    || (c >= 0xe000 && c <= 0xfffd);
            if (!valid) {
                return false;
            }
        }
        return true;
    }
1184746
protected boolean isObject(String text) {
        final String trim = text.trim();
        return trim.startsWith("{") && trim.endsWith("}");
    }
773148
public static boolean isEnglish(final String text, final int start, final int len){
        for(int i=start; i<start+len; i++){
            char c = text.charAt(i);
            if(!isEnglish(c)){
                return false;
            }
        }
        //指定的字符串已经识别为英文串
        //下面要判断英文串是否完整
        if(start>0){
            //判断前一个字符，如果为英文字符则识别失败
            char c = text.charAt(start-1);
            if(isEnglish(c)){
                return false;
            }
        }
        if(start+len < text.length()){
            //判断后一个字符，如果为英文字符则识别失败
            char c = text.charAt(start+len);
            if(isEnglish(c)){
                return false;
            }
        }
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("识别出英文单词：" + text.substring(start, start + len));
        }
        return true;
    }
921465
public static boolean has(String text){
        for(char c : text.toCharArray()){
            if(is(c)){
                return true;
            }
        }
        return false;
    }
557679
public boolean hasStopWord(HString text) {
    if (text == null) {
      return true;
    } else if (text.isInstance(Types.TOKEN)) {
      return isTokenStopWord(Cast.as(text));
    }
    return text.tokens().stream().anyMatch(this::isTokenStopWord);
  }
1270611
public static Treenode search(Treenode start, String text) {
        return search(start.getTreeview(), text, defaultTreenodeSearch);
    }
668583
public T match(CharSequence text, boolean matchPrefix)
    {
        if (root == null)
        {
            throw new IllegalStateException("not compiled");
        }
        int length = text.length();
        for (int ii=0;ii<length;ii++)
        {
            switch (match(text.charAt(ii)))
            {
                case Error:
                    return null;
                case Ok:
                    if (matchPrefix)
                    {
                        T uniqueMatch = state.getUniqueMatch();
                        if (uniqueMatch != null)
                        {
                            state = root;
                            return uniqueMatch;
                        }
                    }
                    break;
                case Match:
                    return getMatched();
            }
        }
        return null;
    }
17073
public boolean isStopWord(HString text) {
    if (text == null) {
      return true;
    } else if (text.isInstance(Types.TOKEN)) {
      return isTokenStopWord(Cast.as(text));
    }
    return text.tokens().stream().allMatch(this::isTokenStopWord);
  }
1178873
public static boolean startsWith( String text , String prefix , int offset , boolean ignoreCase )
    {
        if (ignoreCase)
            return startsWithIgnoreCase(text,prefix,offset);
        else
            return text.startsWith(prefix,offset);
    }
661641
public void setText(final String TEXT) {
        if (null == text) {
            _text = TEXT;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            text.set(TEXT);
        }
    }
13738
public final void setText(@Nullable final String text) {
        boolean hasDisabledDependents = shouldDisableDependents();
        this.text = text;
        persistString(text);
        boolean isDisablingDependents = shouldDisableDependents();

        if (isDisablingDependents != hasDisabledDependents) {
            notifyDependencyChange(isDisablingDependents);
        }

        notifyChanged();
    }
373282
protected boolean validate(String text)
	{
		try
		{
			String[] strings = text.split(",");
			for (int i = 0; i < strings.length; i++)
			{
				Integer.parseInt(strings[i].trim());
			}
			return true;
		}
		catch (NumberFormatException e)
		{
			return false;
		}
	}
1299755
public static Condition textCaseSensitive(final String text) {
    return new Condition("textCaseSensitive") {
      @Override
      public boolean apply(Driver driver, WebElement element) {
        return Html.text.containsCaseSensitive(element.getText(), text);
      }

      @Override
      public String toString() {
        return name + " '" + text + '\'';
      }
    };
  }
117623
public static boolean startsWithIgnoreCase( String text , String prefix , int offset )
    {
        int textLen = text.length();
        int prefixLen = prefix.length();
        
        if (offset < 0 || (offset > textLen - prefixLen))
            return false;
        
        for(int n=0;n<prefixLen;n++)
        {
            char u1 = Character.toUpperCase(text.charAt(n+offset));
            char u2 = Character.toUpperCase(prefix.charAt(n));
            if (u1 != u2)
                return false;
        }
        
        return true;
    }