code: public function split($pattern, $flags = PREG_SPLIT_DELIM_CAPTURE)
      {
          return new Collection(
              array_map(function ($item) {
                  return new static($item);
              }, preg_split($pattern, $this->text, -1, $flags))
          );
      }
docs: Split string by a regular expression
  
  @param string $pattern The pattern to search for, as a string.
  @param int    $flags   [optional] PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_OFFSET_CAPTURE
  
  @return Text[]|Collection