Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Split string by a regular expression
preg_split(    string $pattern,    string $subject,    int $limit = -1,    int $flags 0): array|false
            case str_ends_with($token'?'):

                return new 
InputArgument(trim($token'?'), InputArgument::OPTIONAL$description);

            case 
preg_match('/(.+)\=\*(.+)/'$token$matches):

                return new 
InputArgument($matches[1], InputArgument::IS_ARRAY$descriptionpreg_split('/,\s?/'$matches[2]));

            case 
preg_match('/(.+)\=(.+)/'$token$matches):

                return new 
InputArgument($matches[1], InputArgument::OPTIONAL$description$matches[2]);

            default:
    {

        [
$token$description] = static::extractDescription($token);



        
$matches preg_split('/\s*\|\s*/'$token2);



        if (isset(
$matches[1])) {

            
$shortcut $matches[0];
            case str_ends_with($token'=*'):

                return new 
InputOption(trim($token'=*'), $shortcutInputOption::VALUE_OPTIONAL InputOption::VALUE_IS_ARRAY$description);

            case 
preg_match('/(.+)\=\*(.+)/'$token$matches):

                return new 
InputOption($matches[1], $shortcutInputOption::VALUE_OPTIONAL InputOption::VALUE_IS_ARRAY$descriptionpreg_split('/,\s?/'$matches[2]));

            case 
preg_match('/(.+)\=(.+)/'$token$matches):

                return new 
InputOption($matches[1], $shortcutInputOption::VALUE_OPTIONAL$description$matches[2]);

            default:
    protected static function extractDescription($token)

    {

        
$parts preg_split('/\s+:\s+/'trim($token), 2);



        return 
count($parts) === $parts : [$token''];

    }
            $values

        
);



        
$segments preg_split('/\s+as\s+/i'$this->query->from);



        
$qualifiedColumn end($segments).'.'.$column;
        if (! $table) {

            
$words preg_split('/(_)/u'$name, -1PREG_SPLIT_DELIM_CAPTURE);



            
$lastWord array_pop($words);
    protected function wrapAliasedValue($value$prefixAlias false)

    {

        
$segments preg_split('/\s+as\s+/i'$value);
    {

        
$finder substr($method5);



        
$segments preg_split(

            
'/(And|Or)(?=[A-Z])/'$finder, -1PREG_SPLIT_DELIM_CAPTURE

        
);
        $separator str_contains(strtolower($column), ' as ') ? ' as ' '\.';



        return 
last(preg_split('~'.$separator.'~i'$column));

    }
        $columns $this->compileUpdateColumns($query$values);



        
$alias last(preg_split('/\s+as\s+/i'$query->from));



        
$selectSql $this->compileSelect($query->select($alias.'.ctid'));
    {

        
$table $this->wrapTable($query->from);



        
$alias last(preg_split('/\s+as\s+/i'$query->from));



        
$selectSql $this->compileSelect($query->select($alias.'.ctid'));
        $columns $this->compileUpdateColumns($query$values);



        
$alias last(preg_split('/\s+as\s+/i'$query->from));



        
$selectSql $this->compileSelect($query->select($alias.'.rowid'));
    {

        
$table $this->wrapTable($query->from);



        
$alias last(preg_split('/\s+as\s+/i'$query->from));



        
$selectSql $this->compileSelect($query->select($alias.'.rowid'));
        ]));



        
$migrations collect(preg_split("/\r\n|\n|\r/"$process->getOutput()))->filter(function ($line) {

            return 
stripos($line'sqlite_sequence') === false &&

                   
strlen($line) > 0;

        })->
all();
        ]));



        
$migrations collect(preg_split("/\r\n|\n|\r/"$process->getOutput()))->filter(function ($line) {

            return 
preg_match('/^\s*(--|INSERT\s)/iu'$line) === &&

                   
strlen($line) > 0;

        })->
all();