Checks whether the given node contains a validation matcher
@param node
@return true if node value contains validation matcher, false if not
481224
private boolean isValidationMatcherExpression(Node node) {
        switch (node.getNodeType()) {
            case Node.ELEMENT_NODE:
                return node.getFirstChild() != null &&
                StringUtils.hasText(node.getFirstChild().getNodeValue()) &&
                ValidationMatcherUtils.isValidationMatcherExpression(node.getFirstChild().getNodeValue().trim());

            case Node.ATTRIBUTE_NODE:
                return StringUtils.hasText(node.getNodeValue()) &&
                ValidationMatcherUtils.isValidationMatcherExpression(node.getNodeValue().trim());

            default: return false; //validation matchers makes no sense
        }
    }
217335
function matches(node, sl) {
    if (!node || node.nodeType !== 1) return false;
    var datas = parse(sl),
      len = datas.length;
    if (!datas[len - 1][0]) return false;
    for (; len--;) {
      if (matchOneData(node, datas[len])) return true;
    }
    return false;
  }
638332
function check(node) {
		if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) {
			var flags = isString(node.arguments[1]) ? node.arguments[1].value : "";

			if (allowedFlags) {
				flags = flags.replace(new RegExp("[" + allowedFlags + "]", "gi"), "");
			}

			try {
				void new RegExp(node.arguments[0].value);
			} catch (e) {
				context.report(node, e.message);
			}
			if (flags) {
				try {
					var result = parser.parse("/./" + flags, context.parserOptions);
					if (result.body.length > 0) {
						var expressionStatement = result.body[0];
						var regexp = expressionStatement.expression;
						if (regexp && regexp.value === null) {
							context.report(node, ProblemMessages.noInvalidRegexp, {
								arg: flags
							});
						}
					}
				} catch (ex) {
					context.report(node, ProblemMessages.noInvalidRegexp, {
						arg: flags
					});
				}
			}
		}
	}
858099
public void checkForWellFormedMessageHeader(final Node node)
    {
        final boolean shouldGenerateInterfaces = Boolean.getBoolean(JAVA_GENERATE_INTERFACES);

        final EncodedDataType blockLengthType = (EncodedDataType)containedTypeByNameMap.get("blockLength");
        final EncodedDataType templateIdType = (EncodedDataType)containedTypeByNameMap.get("templateId");
        final EncodedDataType schemaIdType = (EncodedDataType)containedTypeByNameMap.get("schemaId");
        final EncodedDataType versionType = (EncodedDataType)containedTypeByNameMap.get("version");

        if (blockLengthType == null)
        {
            XmlSchemaParser.handleError(node, "composite for message header must have \"blockLength\"");
        }
        else if (!isUnsigned(blockLengthType.primitiveType()))
        {
            XmlSchemaParser.handleError(node, "\"blockLength\" must be unsigned");
        }

        validateHeaderField(node, "blockLength", blockLengthType, UINT16, shouldGenerateInterfaces);
        validateHeaderField(node, "templateId", templateIdType, UINT16, shouldGenerateInterfaces);
        validateHeaderField(node, "schemaId", schemaIdType, UINT16, shouldGenerateInterfaces);
        validateHeaderField(node, "version", versionType, UINT16, shouldGenerateInterfaces);
    }
70618
private boolean isSameGroup(Node node) {
        return node.getNodeType().equals(appContext.getConfig().getNodeType())
                && node.getGroup().equals(appContext.getConfig().getNodeGroup());
    }
1127695
public static boolean hasVetoableAnnotation(AnnotatedNode node) {
        for (AnnotationNode annotation : node.getAnnotations()) {
            if (constrainedClassNode.equals(annotation.getClassNode())) {
                return true;
            }
        }
        return false;
    }
450721
public static boolean hasMixin(final Node node) {
        try {
            return node.isNodeType(FEDORA_WEBAC_ACL);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
220239
public static boolean isEmpty(Node node) {
        return (node == null || (node.children() != null && node.children().size() == 0));
    }
1284977
public static boolean hasMixin(final Node node) {
        try {
            return node.isNodeType(FEDORA_TIME_MAP);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
361884
private boolean checkAnnotations(List<? extends AnnotationTree> annotations, Tree node) {
    for (AnnotationTree annotation : annotations) {
      if (isJ2ObjCIncompatible(annotation)) {
        nodesToStrip.add(node);
        return false;
      }
    }
    return true;
  }
435296
public void checkForValidOffsets(final Node node)
    {
        int offset = 0;

        for (final Type edt : containedTypeByNameMap.values())
        {
            final int offsetAttribute = edt.offsetAttribute();

            if (-1 != offsetAttribute)
            {
                if (offsetAttribute < offset)
                {
                    XmlSchemaParser.handleError(
                        node,
                        String.format("composite element \"%s\" has incorrect offset specified", edt.name()));
                }

                offset = offsetAttribute;
            }

            offset += edt.encodedLength();
        }
    }
590670
@Override
    public MatchType match(int level, Node node) {
        if(! (node instanceof Element)) {
            return MatchType.NOT_A_MATCH;
        }
        Element element = (Element) node;
        if(this.level != level) {
            return MatchType.NOT_A_MATCH;
        } else if(element.getName().equals(elementName) && element.hasAttribute(attributeName)
                && element.attributeValue(attributeName).equals(attributeValue)) {
            return MatchType.NODE_MATCH;
        }
        return MatchType.NOT_A_MATCH;
    }
1072476
public ResultMatcher matches(final Matcher<?> matcher) {
        return new AbstractResultMatcher(path, configuration) {
            public void doMatch(Object actual) {
                isPresent(actual);
                Node node = getNode(actual);
                assertThat("Node \"" + path + "\" does not match.", node.getValue(), (Matcher<? super Object>) matcher);
            }
        };

    }
104957
public static boolean matches(Pattern patternMatcher, Object... elements)
    {
        if (patternMatcher == null) {
            return true;
        }

        for (Object element : elements) {
            if (matches(patternMatcher, element)) {
                return true;
            }
        }

        return false;
    }
701762
@Override
    public MatchType match(int level, Node node) {
        if(! (node instanceof Element)) {
            return MatchType.NOT_A_MATCH;
        }
        Element element = (Element) node;
        if(this.level != level) {
            return MatchType.NOT_A_MATCH;
        } else if(nodename.equals(element.getName())) {
            return MatchType.NODE_MATCH;
        }
        return MatchType.NOT_A_MATCH;
    }
233141
function verify(context, node, pattern, flags) {
    try {
        let found = false

        new RegExpValidator({
            onCapturingGroupEnter(_start, name) {
                if (name) {
                    found = true
                }
            },
            onBackreference(_start, _end, ref) {
                if (typeof ref === "string") {
                    found = true
                }
            },
        }).validatePattern(pattern, 0, pattern.length, flags.includes("u"))

        if (found) {
            context.report({ node, messageId: "forbidden" })
        }
    } catch (error) {
        //istanbul ignore else
        if (error.message.startsWith("Invalid regular expression:")) {
            return
        }
        //istanbul ignore next
        throw error
    }
}
1129047
public static void checkNode(Node node, Node.Type... validTypes) {
		for (Node.Type type : validTypes) {
			if (node.getNodeType() == type) {
				return;
			}
		}
		StringJoiner sj = new StringJoiner(", ");
		for (Node.Type type : validTypes) {
			sj.add(type.toString());
		}
		String nodeName = node.getNodeType().name();
		if (node instanceof NameBearer) {
			nodeName = ((NameBearer) node).getName();
		}
		throw new FuzzerException(nodeName + ": invalid, must be one of " + sj.toString());
	}