Get the regex expression
@param {ASTNode} node node to evaluate
@returns {*} Regex if found else null
@private
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;
        }

    }
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
        }
    }
342434
function(node, className) {
        var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
        return re.test(node.className);
    }
43018
function parseGroupExpression() {
        var expr, expressions, startToken, isValidArrowParameter = true;

        expect('(');

        if (match(')')) {
            lex();
            if (!match('=>')) {
                expect('=>');
            }
            return {
                type: PlaceHolders.ArrowParameterPlaceHolder,
                params: []
            };
        }

        startToken = lookahead;
        if (match('...')) {
            expr = parseRestElement();
            expect(')');
            if (!match('=>')) {
                expect('=>');
            }
            return {
                type: PlaceHolders.ArrowParameterPlaceHolder,
                params: [expr]
            };
        }

        if (match('(')) {
            isValidArrowParameter = false;
        }

        expr = parseAssignmentExpression();

        if (match(',')) {
            expressions = [expr];

            while (startIndex < length) {
                if (!match(',')) {
                    break;
                }
                lex();

                if (match('...')) {
                    if (!isValidArrowParameter) {
                        throwUnexpectedToken(lookahead);
                    }
                    expressions.push(parseRestElement());
                    expect(')');
                    if (!match('=>')) {
                        expect('=>');
                    }
                    return {
                        type: PlaceHolders.ArrowParameterPlaceHolder,
                        params: expressions
                    };
                } else if (match('(')) {
                    isValidArrowParameter = false;
                }

                expressions.push(parseAssignmentExpression());
            }

            expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
        }


        expect(')');

        if (match('=>') && !isValidArrowParameter) {
            throwUnexpectedToken(lookahead);
        }

        return expr;
    }
1011430
function findToken(node, test) {
    let find = null
    traverse(node, {
        enter(child) {
            if (test(child)) {
                find = child
                this.break()
            }
        },
    })
    return find
}
764174
function inlineRegex(regex) {
  return function match(source, state) {
    if (state.inline) {
      return regex.exec(source);
    } else {
      return null;
    }
  };
}
556310
function getDomNode(node, start, ltr, startFromChild, fn, guard) {
    var tmpNode = startFromChild && node[start],
        parent;
    !tmpNode && (tmpNode = node[ltr]);
    while (!tmpNode && (parent = (parent || node).parentNode)) {
        if (parent.tagName == 'BODY' || guard && !guard(parent)) {
            return null;
        }
        tmpNode = parent[ltr];
    }
    if (tmpNode && fn && !fn(tmpNode)) {
        return  getDomNode(tmpNode, start, ltr, false, fn);
    }
    return tmpNode;
}
1370206
function getTextRect (node) {
  if (!isBrowser) return
  if (!range) range = document.createRange()

  range.selectNode(node)

  return range.getBoundingClientRect()
}
261820
function( node ) {
			var out = '',
				j = 0;

			// if node is a text node get its text
			if(node.nodeType && node.nodeType === 3){
				//out += modules.domUtils.getElementText( node );
				var containerNode = modules.domUtils.createNode('div');
				modules.domUtils.appendChild(containerNode, modules.domUtils.clone(node));
				out += modules.domUtils.innerHTML(containerNode);
			}


			// exclude text which has been added with include pattern  -
			if(node.nodeType && node.nodeType === 1 && modules.domUtils.hasAttribute(node, 'data-include') === false){

				// begin tag
				out += '<' + node.tagName.toLowerCase();

				// add attributes
				var attrs = modules.domUtils.getOrderedAttributes(node);
				for (j = 0; j < attrs.length; j++) {
					out += ' ' + attrs[j].name +  '=' + '"' + attrs[j].value + '"';
				}

				if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) === -1){
					out += '>';
				}

				// get the text of the child nodes
				if(node.childNodes && node.childNodes.length > 0){

					for (j = 0; j < node.childNodes.length; j++) {
						var text = this.walkTreeForHtml( node.childNodes[j] );
						if(text !== undefined){
							out += text;
						}
					}
				}

				// end tag
				if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) > -1){
					out += ' />';
				}else{
					out += '</' + node.tagName.toLowerCase() + '>';
				}
			}

			return (out === '')? undefined : out;
		}
282455
function extractDomProperties(domNode, regex, removeDomAttributes = false) {


	if(regex && classof(regex) !== 'RegExp'){
		throw Error('Second argument is passed but it must be a Regular-Expression');
	}

	let domViewAttributes = {};
	let toBeRemovedAttributes = [];

	for(let key in domNode.attributes) {
		if(!domNode.attributes.hasOwnProperty(key)){
			continue;
		}

		let node = domNode.attributes[key];
		if(regex){
			let matched = regex.exec(node.name);
			if(matched !== null) {
				let [ ,name ] = matched;
				domViewAttributes[name] = node.value;
				removeDomAttributes ? toBeRemovedAttributes.push(node.name) : null;
			}
		}
		else if(!regex) {
			domViewAttributes[node.name] = node.value;
		}

	}

	if(removeDomAttributes){
		for(let attribute of toBeRemovedAttributes){
			domNode.removeAttribute(attribute);
		}
	}

	return domViewAttributes;

}
563122
function getFencedCodeBlockValue(node, originalText) {
  const text = originalText.slice(
    node.position.start.offset,
    node.position.end.offset
  );

  const leadingSpaceCount = text.match(/^\s*/)[0].length;
  const replaceRegex = new RegExp(`^\\s{0,${leadingSpaceCount}}`);

  const lineContents = text.split("\n");

  const markerStyle = text[leadingSpaceCount]; // ` or ~
  const marker = text
    .slice(leadingSpaceCount)
    .match(new RegExp(`^[${markerStyle}]+`))[0];

  // https://spec.commonmark.org/0.28/#example-104: Closing fences may be indented by 0-3 spaces
  // https://spec.commonmark.org/0.28/#example-93: The closing code fence must be at least as long as the opening fence
  const hasEndMarker = new RegExp(`^\\s{0,3}${marker}`).test(
    lineContents[lineContents.length - 1].slice(
      getIndent(lineContents.length - 1)
    )
  );

  return lineContents
    .slice(1, hasEndMarker ? -1 : undefined)
    .map((x, i) => x.slice(getIndent(i + 1)).replace(replaceRegex, ""))
    .join("\n");

  function getIndent(lineIndex) {
    return node.position.indent[lineIndex - 1] - 1;
  }
}
1343888
public JsonNode evaluate(JsonNode node) {
		if(innerExpression==null) {
			return getValue(node, property);
		} else {
			return getValue(innerExpression.evaluate(node), property);
		}
	}
175522
function(node) {
    // Make sure that this is a call expression
    if (!node || node.type !== 'CallExpression' ) {
      return;
    }
    // Get the callee property
    var property;
    if (node.callee && node.callee.property) {
      property = node.callee.property;
    }
    // Return the identifier name of the callee
    if (property && property.type === 'Identifier') {
      return property.name;
    }
  }
935477
function checkLiteral(node) {
            const token = sourceCode.getFirstToken(node),
                nodeType = token.type,
                nodeValue = token.value;

            if (nodeType === "RegularExpression") {
                checkRegex(node, nodeValue, token.range[0]);
            }
        }
528498
public static String getNodeText(Node<?> node, InputBuffer inputBuffer) {
        checkArgNotNull(node, "node");
        checkArgNotNull(inputBuffer, "inputBuffer");
        if (node.hasError()) {
            // if the node has a parse error we cannot simply cut a string out of the underlying input buffer, since we
            // would also include illegal characters, so we need to build it constructively
            StringBuilder sb = new StringBuilder();
            for (int i = node.getStartIndex(); i < node.getEndIndex(); i++) {
                char c = inputBuffer.charAt(i);
                switch (c) {
                    case Chars.DEL_ERROR:
                        i++;
                        break;
                    case Chars.INS_ERROR:
                    case Chars.EOI:
                        break;
                    case Chars.RESYNC_START:
                        i++;
                        while (inputBuffer.charAt(i) != Chars.RESYNC_END) i++;
                        break;
                    case Chars.RESYNC_END:
                    case Chars.RESYNC_EOI:
                    case Chars.RESYNC:
                        // we should only see proper RESYNC_START / RESYNC_END blocks
                        throw new IllegalStateException();
                    default:
                        sb.append(c);
                }
            }
            return sb.toString();
        }        
        return inputBuffer.extract(node.getStartIndex(), node.getEndIndex());
    }
1034140
function (node,isInStart) {
        if(node.nodeType != 3)
            return false;
        var text = node.nodeValue;
        if(isInStart){
            return new RegExp('^' + domUtils.fillChar).test(text)
        }
        return !text.replace(new RegExp(domUtils.fillChar,'g'), '').length
    }
922725
public String find(String str, String regex) {
		if (str == null || regex == null)
			return "";
		Matcher m = Pattern.compile(regex).matcher(str);
		if (m.find()) {
			return m.group();
		} else
			return "";
	}