Checks whether the value of the given property key of the given node
if not null and matches the given regular expression.

@param node
@param key
@param expression
@param errorBuffer
@return true if string matches expression
423132
public static boolean isValidStringMatchingRegex(final GraphObject node, final PropertyKey<String> key, final String expression, final ErrorBuffer errorBuffer) {

		final String value = node.getProperty(key);

		if (isValidStringMatchingRegex(value, expression)) {
			return true;
		}

		// no match
		errorBuffer.add(new MatchToken(node.getType(), key, expression));
		return false;
	}
1030607
public static final void validateKey(String key) throws IllegalArgumentException {
        if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) {
            LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN);
            throw new IllegalArgumentException(key+" does not appear to be a valid blob key");
        }
    }
1333630
protected void validateRegex(String field, String regExpression, boolean isCaseSensitive, String errorKey, String errorMessage) {
        String value = controller.getPara(field);
        if (value == null) {
        	addError(errorKey, errorMessage);
        	return ;
        }
        Pattern pattern = isCaseSensitive ? Pattern.compile(regExpression) : Pattern.compile(regExpression, Pattern.CASE_INSENSITIVE);
        Matcher matcher = pattern.matcher(value);
        if (!matcher.matches()) {
        	addError(errorKey, errorMessage);
        }
	}
879606
public boolean matchKey (final String key) {
        if (key == null) return false;
        for (int i = 0; i < values.length; ++i)
            if (values[i].equals(key)) return true;
        return false;
    }
1358631
function (node) {
      if (node.superClass) {
        return new RegExp('^(' + pragma + '\\.)?PureComponent$').test(sourceCode.getText(node.superClass));
      }
      return false;
    }
494160
public void validateAttribute(final String key, final String value) throws Exception {
        for (ITenantOperationsListener listener : tenantOperationsListeners) {
            // Will throw an exception if not valid
            listener.validateAttribute(key, value);
        }
    }
195219
function getRegExp(node) {

        if (node.value instanceof RegExp) {
            return node.value;
        } else if (typeof node.value === "string") {

            var parent = context.getAncestors().pop();
            if ((parent.type === "NewExpression" || parent.type === "CallExpression") &&
            parent.callee.type === "Identifier" && parent.callee.name === "RegExp") {

                // there could be an invalid regular expression string
                try {
                    return new RegExp(node.value);
                } catch (ex) {
                    return null;
                }

            }
        } else {
            return null;
        }

    }
1256541
public void containsEntry(@NullableDecl Object key, @NullableDecl Object value) {
    Entry<Object, Object> entry = Maps.immutableEntry(key, value);
    if (!actual().entrySet().contains(entry)) {
      List<Object> keyList = Lists.newArrayList(key);
      List<Object> valueList = Lists.newArrayList(value);
      if (hasMatchingToStringPair(actual().keySet(), keyList)) {
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s contains entry <%s (%s)>. However, it does contain keys "
                        + "<%s>.",
                    actualAsString(),
                    entry,
                    objectToTypeName(entry),
                    countDuplicatesAndAddTypeInfo(
                        retainMatchingToString(actual().keySet(), keyList /* itemsToCheck */)))));
      } else if (hasMatchingToStringPair(actual().values(), valueList)) {
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s contains entry <%s (%s)>. However, it does contain values "
                        + "<%s>.",
                    actualAsString(),
                    entry,
                    objectToTypeName(entry),
                    countDuplicatesAndAddTypeInfo(
                        retainMatchingToString(actual().values(), valueList /* itemsToCheck */)))));
      } else if (actual().containsKey(key)) {
        Object actualValue = actual().get(key);
        /*
         * In the case of a null expected or actual value, clarify that the key *is* present and
         * *is* expected to be present. That is, get() isn't returning null to indicate that the key
         * is missing, and the user isn't making an assertion that the key is missing.
         */
        StandardSubjectBuilder check = check("get(%s)", key);
        if (value == null || actualValue == null) {
          check = check.withMessage("key is present but with a different value");
        }
        // See the comment on IterableSubject's use of failEqualityCheckForEqualsWithoutDescription.
        check.that(actualValue).failEqualityCheckForEqualsWithoutDescription(value);
      } else if (actual().containsValue(value)) {
        Set<Object> keys = new LinkedHashSet<>();
        for (Entry<?, ?> actualEntry : actual().entrySet()) {
          if (Objects.equal(actualEntry.getValue(), value)) {
            keys.add(actualEntry.getKey());
          }
        }
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s contains entry <%s>. "
                        + "However, the following keys are mapped to <%s>: %s",
                    actualAsString(), entry, value, keys)));
      } else {
        failWithActual("expected to contain entry", entry);
      }
    }
  }
948371
static String getExpressValue(final String key) {
    if (isExpression(key)) {
      String keyValue = getSystemProperty(key.substring(2, key.length() - 1));
      return keyValue == null ? key : keyValue;
    } else {
      return key;
    }
  }
51657
function (value, node) {
        var valid = false;
        if (typeof value === (node.name === "component" ? "object" : "function"))
            valid = (_cs.annotation(value, "type") === node.name);
        return valid;
    }
645609
@SuppressWarnings("unchecked")
    public final BooleanExpression contains(Expression<K> key, Expression<V> value) {
        return get(key).eq((Expression) value);
    }
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;
  }
1339557
public static void ensureXPathNotNull(Node node, String expression) {
    if (node == null) {
      throw LOG.unableToFindXPathExpression(expression);
    }
  }
815574
public boolean isNullOrEmpty(String section, String key) {
	String value = getKeyValueEL(section, key);
	return (value == null || value.length() == 0);
    }
1074270
private static boolean isValidKey(final String s) {
        // Equivalent to this regex \*|[_a-zA-Z](?:[-_a-zA-Z0-9]*[_a-zA-Z0-9]) but faster
        if (s == null) {
            return false;
        }
        if (s.equals(WILDCARD_VALUE)) {
            return true;
        }
        int lastIndex = s.length() - 1;
        if (lastIndex == -1) {
            return false;
        }
        if (!isValidKeyStartCharacter(s.charAt(0))) {
          return false;
        }
        for (int i = 1; i < lastIndex; i++) {
          if (!isValidKeyCharacter(s.charAt(i))) {
            return false;
          }
        }
        if (lastIndex > 0 && !isValidKeyEndCharacter(s.charAt(lastIndex))) {
          return false;
        }
        return true;
      }
615004
public boolean is(ComparisonExpression expr) {
		try {
			if (expr != null) {
				return expr.evaluate(node);
			}
		} catch (MissingNodeException e) {
			return false;
		}

		return false;
	}
706295
protected boolean check(String value, String regex) {
		Pattern pattern = Pattern.compile(regex);
		return pattern.matcher(value).matches();
	}