returns methods mathcing the given pattern

@param   string $regex the regular expression to match (without trailing slashes)
@return  array<MoufXmlReflectionMethod>
163038
public function getMethodsByPattern($regex)
    {
    	$methods = array();
        foreach ($this->xmlRoot->method as $method) {
    		if (preg_match("/$regex/", $method['name'])) {
		        $moufRefMethod = new MoufXmlReflectionMethod($this, $method);
		        $methods[] = $moufRefMethod;
    		}
    	}
    	return $methods;
    }
749664
protected function toRegex($regex, $modifiers = '')
	{
		$regex = $regex instanceof RegularExpressionContract ? $regex : Regex::from($regex);
		$regex->addModifiers($modifiers.Modifiers::UTF8);
		return $regex;
	}
1215045
public function split($regex = '//u', $limit = -1){
		
		if(!\is_string($regex)){
			throw new \InvalidArgumentException('$regex is not a string');
		}
		
		if(!\is_numeric($limit)){
			throw new \InvalidArgumentException('$limit is not a number');
		}
		
		return \preg_split($regex, $this->_Value, $limit, \PREG_SPLIT_NO_EMPTY);
		
	}
797323
private String convertPerlToJavaRegex(String regex) {
		regex = regex.substring(1);
		int lastIndex = regex.lastIndexOf('/');
		regex = regex.substring(0, lastIndex);
		return regex;
	}
610782
public function matches(string $regex): bool
    {
        if (\func_num_args() !== 1) {
            throw new LogicException('Offset is no longer supported');
        }

        return RegExp::of($regex)->matches($this);
    }
849245
private function regex_search_array($array, $regex) {
		$return = array();
		foreach ($array as $key => $item) {
	 		if(is_array($item)) {
	 			$tmp = $this->regex_search_array($item, $regex);
	 			if($tmp)
	 				$return[$key] = $tmp;
	 		} elseif(!is_object($item)) {
	 			//if (preg_match("/^.*".$regex.".*$/", $this->stripAccents($item))) {
	 			if (preg_match("/".$regex."/i", $this->stripAccents($item))) {
	                $return[$key] = $item;
	           	}
	 		}
		}
	 	
	    return $return;
	}
1064419
public function iShouldSeeRegex($regex)
    {
        $actual = $this->getSession()->getPage()->getText();
        $actual = preg_replace('/\s+/u', ' ', $actual);
        
        if (0 === preg_match(ReformatRegex::spaceTabsEqual(sprintf('/%s/', $regex)), $actual)) {
            // No matches meaning we haven't found what were looking for
            throw new ExpectationException(
                sprintf(
                    'The content %s can not be found on %s',
                    $regex,
                    $this->getSession()->getCurrentUrl()
                ),
                $this->getSession()->getDriver()
            );
        }
    }
1325920
public function match($regex)
    {
        $match = array();
        if($this->isValidRegex($regex) && preg_match($regex, $this->toString(), $match)===1)
        {
            return new ObjectArray($match);
        }
        return null;
    }
91568
public function responseMatches($regex)
    {
        $actual = $this->session->getPage()->getContent();
        $message = sprintf('The pattern %s was not found anywhere in the HTML response of the page.', $regex);

        $this->assert((bool) preg_match($regex, $actual), $message);
    }
185330
public static function ruleRegexInverse($regex)
    {
        $args = func_get_args();
        $regex = join(':', $args);

        /*not in format "/../<modifier>", "#..#<modifier>"  nor "~..~<modifier>" */
        if (!preg_match('/^([\/#~]).+\1[msugex]*$/', $regex)) {
            $regex = '/'. stripslashes($regex). '/';
        }

        return function ($input) use ($regex) {
            return !preg_match($regex, $input);
        };
    }
718602
public static Predicate<String> matchesRegex(final String regex) {
		final Pattern pattern = Pattern.compile(regex);
		return matchesRegex(pattern);
	}
1048954
protected function compile($pattern)
    {
        if (isset($this->compileCache[$pattern])) {
            return $this->compileCache[$pattern];
        }

        $pcre = '(^';

        do {
            switch (true) {
                case preg_match('(^[^{]+)', $pattern, $match):
                    $pattern = substr($pattern, strlen($match[0]));
                    $pcre .= preg_quote($match[0]);
                    break;

                case preg_match('(^' . self::STANDARD_VARIABLE_REGEX . ')', $pattern, $match):
                    $pattern = substr($pattern, strlen($match[0]));
                    $pcre .= '(?P<' . $match[1] . '>[^/]+)';
                    break;

                case preg_match('(^' . self::SLASHES_VARIABLE_REGEX . ')', $pattern, $match):
                    $pattern = substr($pattern, strlen($match[0]));
                    $pcre .= '(?P<' . $match[1] . '>.+)';
                    break;

                default:
                    throw new Exceptions\InvalidArgumentException("Invalid pattern part: '$pattern'.");
            }
        } while ($pattern);

        $pcre .= '$)S';

        $this->compileCache[$pattern] = $pcre;

        return $pcre;
    }
1110236
static public function prepareXsdPatternForPcre($pattern)
    {
        // XML schema always implicitly anchors the entire regular expression
        // because there is no carret (^) nor dollar ($) signs.
        // see http://www.regular-expressions.info/xml.html
        $pattern = self::escapeSymbols($pattern, array('$', '^'));
        $pattern = self::pregAddDelimiter('^' . $pattern . '$');

        // XSD regexp always case-sensitive (nothing to do), dot matches white-spaces (use PCRE_DOTALL).
        $pattern .= 's';
        
        return $pattern;
    }
256843
public function pregSplit(string $regex, int $limit = -1): StreamInterface
    {
        $strings = \preg_split($regex, $this->value, $limit);
        $stream = new Stream(self::class);

        foreach ($strings as $string) {
            $stream = $stream->add(new self($string, $this->encoding));
        }

        return $stream;
    }
880056
protected function convert(/*# string */ $pattern)/*# : array */
    {
        // regex
        $groupname   = "\s*([a-zA-Z][a-zA-Z0-9_]*)\s*";
        $grouptype   = ":\s*([^{}]*(?:\{(?-1)\}[^{}]*)*)";
        $placeholder = sprintf("\{%s(?:%s)?\}", $groupname, $grouptype);
        $segmenttype = "[^/]++";

        // count placeholders
        $map = $m = [];
        if (preg_match_all('~'. $placeholder .'~x', $pattern, $m)) {
            $map = $m[1];
        }

        // full regex
        $result = preg_replace([
                '~' . $placeholder . '(*SKIP)(*FAIL) | \[~x',
                '~' . $placeholder . '(*SKIP)(*FAIL) | \]~x',
                '~\{' . $groupname . '\}~x',
                '~' . $placeholder . '~x',
            ], [
                '(?:',  // replace '['
                ')?',   // replace ']'
                '{\\1:' . $segmenttype . '}',   // add segementtype
                '(\\2)'                         // group it
            ], strtr('/' . trim($pattern, '/'), $this->shortcuts)
        );
        return [ $result, $map ];
    }
34591
protected static function replaceOptionalSegments($regex)
    {
        preg_match(chr(1) . '\(/([a-z][a-zA-Z0-9_,]*)\)' . chr(1), $regex, $matches);

        if (!$matches) {
            return $regex;
        }

        $list = explode(',', $matches[1]);
        $head = '';

        if (substr($regex, 0, 2) === '(/') {
            $name = array_shift($list);
            $head = "/(\{{$name}\})?";
        }

        $tail = '';

        foreach ($list as $name) {
            $head .= "(/({$name})";
            $tail .= ')?';
        }

        $repl = $head . $tail;

        return str_replace($matches[0], $repl, $regex);
    }
219401
public function extract($path, $regex = null)
    {
        $directory = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
        $iterator = new RecursiveIteratorIterator($directory);

        if ($regex) {
            $iterator = new RegexIterator($iterator, $regex);
        }

        $this->iterator->attachIterator($iterator);

        return $this;
    }