function regex ($regexp, $preg_flags = 0, $useKeys = false)
  {
    $this->setIterator (
      new RegexIterator ($this->getIterator (), $regexp, RegexIterator::ALL_MATCHES,
        $useKeys ? RegexIterator::USE_KEY : 0,
        $preg_flags)
    );
    return $this;
  }
function regex ($regexp, $preg_flags = 0, $useKeys = false)
  {
    $this->setIterator (
      new RegexIterator ($this->getIterator (), $regexp, RegexIterator::ALL_MATCHES,
        $useKeys ? RegexIterator::USE_KEY : 0,
        $preg_flags)
    );
    return $this;
  }
function regex ( $ regexp , $ preg_flags = 0 , $ useKeys = false ) { $ this -> setIterator ( new RegexIterator ( $ this -> getIterator ( ) , $ regexp , RegexIterator :: ALL_MATCHES , $ useKeys ? RegexIterator :: USE_KEY : 0 , $ preg_flags ) ) ; return $ this ; }
Transforms data into arrays of regular expression matches for each item.

@param string $regexp     The regular expression to match.
@param int    $preg_flags The regular expression flags. Can be a combination of: PREG_PATTERN_ORDER,
PREG_SET_ORDER, PREG_OFFSET_CAPTURE.
@param bool   $useKeys    When `true`, the iterated keys will be used instead of the corresponding values.
@return $this
Transforms data into arrays of regular expression matches for each item .