Search for an Identifier regular expression.

@param idRegex
the regular expression to search.
@return {@code true} if the request was sent, else {@code false}.
352713
public boolean searchIdRegex(final String idRegex) {
    if (idRegex == null) {
      log.error("Unable to search for a null Identifier regex.");
      return false;
    }
    IdSearchMessage message = new IdSearchMessage();
    message.setIdRegex(idRegex);
    this.session.write(message);
    log.debug("Sent {}", message);

    return true;
  }
145532
private static boolean matchesWildcardPublicSuffix(String domain) {
    final String[] pieces = domain.split(DOT_REGEX, 2);
    return pieces.length == 2 && PublicSuffixPatterns.UNDER.containsKey(pieces[1]);
  }
830330
private void checkInstancesMatchRegex(@Nullable String regex) {
        if (regex != null) {
            Pattern pattern = Pattern.compile(regex);
            instances().forEach(resource -> {
                String value = (String) resource.value();
                Matcher matcher = pattern.matcher(value);
                if (!matcher.matches()) {
                    throw TransactionException.regexFailure(this, value, regex);
                }
            });
        }
    }
218646
private boolean matchPostagRegexp(AnalyzedTokenReadings aToken, Pattern pattern) {
    for (AnalyzedToken analyzedToken : aToken) {
      String posTag = analyzedToken.getPOSTag();
      if (posTag == null) {
        posTag = "UNKNOWN";
      }
      final Matcher m = pattern.matcher(posTag);
      if (m.matches()) {
        return true;
      }
    }
    return false;
  }
605677
public static String extractFromResourceId(String id, String identifier) {
        if (id == null || identifier == null) {
            return id;
        }
        Pattern pattern = Pattern.compile(identifier + "/[-\\w._]+");
        Matcher matcher = pattern.matcher(id);
        if (matcher.find()) {
            return matcher.group().split("/")[1];
        } else {
            return null;
        }
    }
479214
public static boolean isValidServiceId(String name) {
        return name != null && name.length() > 0 && SERVICE_ID_REGEX.matcher(name).matches() && Character.isLetter(name.charAt(0));
    }
846090
@Override
  public void exitIdentifier(VersionParser.IdentifierContext ctx) {
    String postfix = ctx.getText();
    // A numeric postfix cannot have leading zeroes
    // FIXME: Check to see if an alphanumeric postfix with leading zeroes counts
    Matcher m = numericHasLeadingZeroes.matcher(postfix);
    while (m.find()) {
      postfix = m.replaceAll("");
    }
    // Hack to ensure correct parsing by SemanticVersion code. A postfix MUST start with a dash, digit, or letter
    while (!postfix.isEmpty() && !startsWithDigitLetterOrHyphen.matcher(postfix).find()) {
      postfix = postfix.substring(1);
    }
    stack.push(postfix);
  }
66296
private static boolean match(String regExp, String userInput) {
        Pattern pattern = Pattern.compile(regExp);
        Matcher matcher = pattern.matcher(userInput);
        if (matcher.find())
            return true;
        else
            return false;
    }
566712
private boolean isValidDiscriminator(String s) {
        // Could simply do this regex match, but the actual code here is about 60x faster
        // return java.util.regex.Pattern.matches("", s);
        if (s.indexOf(':') != -1 || s.indexOf('*') != -1)
            return false;
        int last = s.length();
        if (last > 0 && (s.charAt(0) == '/' || s.charAt(0) == '.'))
            return false;
        int i = s.indexOf('/');
        while (i++ != -1) {
            if (i == last || s.charAt(i) == '/' || s.charAt(i) == '.')
                return false;
            i = s.indexOf('/', i);
        }
        return true;
    }
1271214
public boolean matchesPosTagRegex(String posTagRegex) {
    Pattern pattern = Pattern.compile(posTagRegex);
    boolean found = false;
    for (AnalyzedToken reading : anTokReadings) {
      if (reading.getPOSTag() != null) {
        found = pattern.matcher(reading.getPOSTag()).matches();
        if (found) {
          break;
        }
      }
    }
    return found;
  }
1030495
private boolean isStringTokenMatched(AnalyzedToken token) {
    String testToken = getTestToken(token);
    if (stringRegExp) {
      Matcher m = pattern.matcher(new InterruptibleCharSequence(testToken));
      return m.matches();
    }
    if (caseSensitive) {
      return stringToken.equals(testToken);
    }
    return stringToken.equalsIgnoreCase(testToken);
  }
474920
private String stringId() throws RecognitionException {
        if ( input.LA( 1 ) == DRL5Lexer.ID ) {
            Token id = match( input,
                              DRL5Lexer.ID,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return id.getText();
        } else if ( input.LA( 1 ) == DRL5Lexer.STRING ) {
            Token id = match( input,
                              DRL5Lexer.STRING,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return StringUtils.unescapeJava( safeStripStringDelimiters( id.getText() ) );
        } else {
            throw new MismatchedTokenException( DRL5Lexer.ID,
                                                input );
        }
    }
1288996
private static String getRegEx(int position, String... options) {

        String value = "" + position;
        for (int i = 0; i < options.length; i++) {
            value += "," + options[i];
        }
        return "{" + value + "}";
    }
220870
private boolean includes(String identifier) {
    if (includes.isEmpty()) return !exclude(identifier);

    String includeMatch = null;
    String excludeMatch = null;
    for (String rule = identifier; rule != null; rule = enclosing(rule)) {
      if (excludes.contains(rule)) {
        excludeMatch = rule;
      }
      if (includes.contains(rule)) {
        includeMatch = rule;
      }
    }
    if (excludeMatch != null) {
      usedExcludes.add(excludeMatch);
      return false;
    }
    if (includeMatch != null) {
      usedIncludes.add(includeMatch);
      return true;
    }
    return false;
  }
926019
@SuppressWarnings({"ConstantConditions", "squid:S2583"})
    private static CharSequence validate(CharSequence id) {
        if (id == null) {
            throw new IllegalArgumentException("Exception ID can't be null");
        }
        if (isInvalid(id)) {
            throw new IllegalArgumentException(
                "Invalid ID given as an Exception ID: " + id
            );
        }
        return id;
    }
1298669
public boolean isIndexed(String expression) {
    if (expression == null || expression.length() == 0) { return false; }
    for (int i = 0; i < expression.length(); i++) {
      char c = expression.charAt(i);
      if (c == Nested || c == MappedStart) {
        return false;
      } else if (c == IndexedStart) { return true; }
    }
    return false;
  }
687573
boolean scanSpecialIdentifier(String identifier) {

        int length = identifier.length();

        if (limit - currentPosition < length) {
            return false;
        }

        for (int i = 0; i < length; i++) {
            int character = identifier.charAt(i);

            if (character == sqlString.charAt(currentPosition + i)) {
                continue;
            }

            if (character
                    == Character.toUpperCase(sqlString.charAt(currentPosition
                        + i))) {
                continue;
            }

            return false;
        }

        currentPosition += length;

        return true;
    }