src/Analyse/Callback/Iterate/ThroughGetter.php
protected function findIt(array $searchArray, $haystack)
    {

        // Defining our regex.
        $regex = '/(?<=###0###).*?(?=###1###)/';

        // Regex escaping our search stuff
        $searchArray[0] = $this->regexEscaping($searchArray[0]);
        $searchArray[1] = $this->regexEscaping($searchArray[1]);

        // Add the search stuff to the regex
        $regex = str_replace('###0###', $searchArray[0], $regex);
        $regex = str_replace('###1###', $searchArray[1], $regex);

        // Trigger the search.
        preg_match_all($regex, $haystack, $findings);

        // Return the file name as well as stuff from the path.
        return $findings[0];
    }
protected function findIt(array $searchArray, $haystack)
    {

        // Defining our regex.
        $regex = '/(?<=###0###).*?(?=###1###)/';

        // Regex escaping our search stuff
        $searchArray[0] = $this->regexEscaping($searchArray[0]);
        $searchArray[1] = $this->regexEscaping($searchArray[1]);

        // Add the search stuff to the regex
        $regex = str_replace('###0###', $searchArray[0], $regex);
        $regex = str_replace('###1###', $searchArray[1], $regex);

        // Trigger the search.
        preg_match_all($regex, $haystack, $findings);

        // Return the file name as well as stuff from the path.
        return $findings[0];
    }
protected function findIt ( array $ searchArray , $ haystack ) { // Defining our regex. $ regex = '/(?<=###0###).*?(?=###1###)/' ; // Regex escaping our search stuff $ searchArray [ 0 ] = $ this -> regexEscaping ( $ searchArray [ 0 ] ) ; $ searchArray [ 1 ] = $ this -> regexEscaping ( $ searchArray [ 1 ] ) ; // Add the search stuff to the regex $ regex = str_replace ( '###0###' , $ searchArray [ 0 ] , $ regex ) ; $ regex = str_replace ( '###1###' , $ searchArray [ 1 ] , $ regex ) ; // Trigger the search. preg_match_all ( $ regex , $ haystack , $ findings ) ; // Return the file name as well as stuff from the path. return $ findings [ 0 ] ; }
Searching for stuff via regex.
Yay, dynamic regex stuff for fun and profit!

@param array $searchArray
The search definition.
@param string $haystack
The haystack, obviously.

@return array
The findings.
Searching for stuff via regex . Yay dynamic regex stuff for fun and profit!