/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isEndAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_ENDSWITH.equals(getMatchRule()); } //
@Override public String createRegEx(String searchExp) { if (isAutoDetect()) { StringBuffer buf = new StringBuffer(searchExp.length() + 4); if (!hasStartAnchor(searchExp)) { if (isStartAnchored()) { buf.append("^"); } } //PENDING: doesn't escape contained regex metacharacters... buf.append(searchExp); if (!hasEndAnchor(searchExp)) { if (isEndAnchored()) { buf.append("$"); } } return buf.toString(); } return super.createRegEx(searchExp); }
@Override public String createRegEx(String searchExp) { if (isAutoDetect()) { StringBuffer buf = new StringBuffer(searchExp.length() + 4); if (!hasStartAnchor(searchExp)) { if (isStartAnchored()) { buf.append("^"); } } //PENDING: doesn't escape contained regex metacharacters... buf.append(searchExp); if (!hasEndAnchor(searchExp)) { if (isEndAnchored()) { buf.append("$"); } } return buf.toString(); } return super.createRegEx(searchExp); }
/** * Creates and sets the strategy to use for compiling a pattern from * rawtext. * * NOTE: This is imcomplete (in fact it wasn't implemented at * all) - only recognizes REGEX_ANCHORED, every other value * results in REGEX_MATCH_RULES. * * @param mode the String key of the match strategy to use. */ protected void createRegexCreator(String mode) { if (REGEX_ANCHORED.equals(mode)) { setRegexCreator(new AnchoredSearchMode()); } else { setRegexCreator(new RegexCreator()); } }
/** * Creates and sets the strategy to use for compiling a pattern from * rawtext. * * NOTE: This is imcomplete (in fact it wasn't implemented at * all) - only recognizes REGEX_ANCHORED, every other value * results in REGEX_MATCH_RULES. * * @param mode the String key of the match strategy to use. */ protected void createRegexCreator(String mode) { if (REGEX_ANCHORED.equals(mode)) { setRegexCreator(new AnchoredSearchMode()); } else { setRegexCreator(new RegexCreator()); } }
/** * Creates and sets the strategy to use for compiling a pattern from * rawtext. * * NOTE: This is imcomplete (in fact it wasn't implemented at * all) - only recognizes REGEX_ANCHORED, every other value * results in REGEX_MATCH_RULES. * * @param mode the String key of the match strategy to use. */ protected void createRegexCreator(String mode) { if (REGEX_ANCHORED.equals(mode)) { setRegexCreator(new AnchoredSearchMode()); } else { setRegexCreator(new RegexCreator()); } }
@Override public String createRegEx(String searchExp) { if (isAutoDetect()) { StringBuffer buf = new StringBuffer(searchExp.length() + 4); if (!hasStartAnchor(searchExp)) { if (isStartAnchored()) { buf.append("^"); } } //PENDING: doesn't escape contained regex metacharacters... buf.append(searchExp); if (!hasEndAnchor(searchExp)) { if (isEndAnchored()) { buf.append("$"); } } return buf.toString(); } return super.createRegEx(searchExp); }
@Override public String createRegEx(String searchExp) { if (isAutoDetect()) { StringBuffer buf = new StringBuffer(searchExp.length() + 4); if (!hasStartAnchor(searchExp)) { if (isStartAnchored()) { buf.append("^"); } } //PENDING: doesn't escape contained regex metacharacters... buf.append(searchExp); if (!hasEndAnchor(searchExp)) { if (isEndAnchored()) { buf.append("$"); } } return buf.toString(); } return super.createRegEx(searchExp); }
/** * Creates and sets the strategy to use for compiling a pattern from * rawtext. * * NOTE: This is imcomplete (in fact it wasn't implemented at * all) - only recognizes REGEX_ANCHORED, every other value * results in REGEX_MATCH_RULES. * * @param mode the String key of the match strategy to use. */ protected void createRegexCreator(String mode) { if (REGEX_ANCHORED.equals(mode)) { setRegexCreator(new AnchoredSearchMode()); } else { setRegexCreator(new RegexCreator()); } }
/** * Creates and sets the strategy to use for compiling a pattern from * rawtext. * * NOTE: This is imcomplete (in fact it wasn't implemented at * all) - only recognizes REGEX_ANCHORED, every other value * results in REGEX_MATCH_RULES. * * @param mode the String key of the match strategy to use. */ protected void createRegexCreator(String mode) { if (REGEX_ANCHORED.equals(mode)) { setRegexCreator(new AnchoredSearchMode()); } else { setRegexCreator(new RegexCreator()); } }
@Override public String createRegEx(String searchExp) { if (isAutoDetect()) { StringBuffer buf = new StringBuffer(searchExp.length() + 4); if (!hasStartAnchor(searchExp)) { if (isStartAnchored()) { buf.append("^"); } } //PENDING: doesn't escape contained regex metacharacters... buf.append(searchExp); if (!hasEndAnchor(searchExp)) { if (isEndAnchored()) { buf.append("$"); } } return buf.toString(); } return super.createRegEx(searchExp); }
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isEndAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_ENDSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isStartAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_STARTSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isStartAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_STARTSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isStartAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_STARTSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isStartAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_STARTSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isEndAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_ENDSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isStartAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_STARTSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isEndAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_ENDSWITH.equals(getMatchRule()); } //
/** * returns true if the pattern must match from the beginning of the string, * or false if the pattern can match anywhere in a string. */ public boolean isEndAnchored() { return MATCH_RULE_EQUALS.equals(getMatchRule()) || MATCH_RULE_ENDSWITH.equals(getMatchRule()); } //