private function matchRegexRule($word, $ruleType)
    {
        // Cycle through the regex rules.
        foreach ($this->rules[$ruleType] as $regex => $replacement) {
            $matches = 0;
            $matchedWord = preg_replace($regex, $replacement, $word, -1, $matches);

            if ($matches > 0) {
                return $matchedWord;
            }
        }

        return false;
    }
private function matchRegexRule($word, $ruleType)
    {
        // Cycle through the regex rules.
        foreach ($this->rules[$ruleType] as $regex => $replacement) {
            $matches = 0;
            $matchedWord = preg_replace($regex, $replacement, $word, -1, $matches);

            if ($matches > 0) {
                return $matchedWord;
            }
        }

        return false;
    }
private function matchRegexRule ( $ word , $ ruleType ) { // Cycle through the regex rules. foreach ( $ this -> rules [ $ ruleType ] as $ regex => $ replacement ) { $ matches = 0 ; $ matchedWord = preg_replace ( $ regex , $ replacement , $ word , - 1 , $ matches ) ; if ( $ matches > 0 ) { return $ matchedWord ; } } return false ; }
Execute a regex from rules.

The 'plural' rule type expects a singular word.
The 'singular' rule type expects a plural word.

@param   string $word     The string input.
@param   string $ruleType String (eg, singular|plural)

@return  mixed  An inflected string, or false if no rule could be applied.

@since   2.0
Execute a regex from rules .