Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Split string by a regular expression
<?php preg_split(    string $pattern,    string $subject,    int $limit = -1,    int $flags = 0): array|false
<?php         $data_type = null;

        $modifiers = [];



        $tokens = preg_split('#("|\').*?\1(*SKIP)(*FAIL)|\s+#', $definition);

        foreach ($tokens as $token) {

            $parts = explode(':', $token);

            $value = $parts[0];
<?php     private function analyzeValue($value)

    {

        return preg_split('/,([ \t]+)?/', $value);

    }

}
<?php         $data = [];

        if (!empty($with)) {

            $data = preg_split('/,([ \t]+)?/', substr($with, 5));

        }



        $type = SendStatement::TYPE_MAIL;
<?php         $data = [];

        if (!empty($with)) {

            $data = preg_split('/,([ \t]+)?/', substr($with, 5));

        }



        return new SendStatement($notification, $model, $data, SendStatement::TYPE_NOTIFICATION_WITH_MODEL);
<?php     private function analyzeValidate($statement)

    {

        return new ValidateStatement(preg_split('/,([ \t]+)?/', $statement));

    }



    private function parseWithStatement(string $statement)
<?php         $data = [];



        if (!empty($with)) {

            $data = preg_split('/,([ \t]+)?/', substr($with, 5));

        }



        return [$object, $data];
<?php     private function extractTokens(string $statement, int $limit = -1)

    {

        return array_pad(preg_split('/[ \t]+/', $statement, $limit), $limit, null);

    }



    private function analyzeQuery($statement)
<?php             return new EloquentStatement('update', $statement);

        }



        $columns = preg_split('/,([ \t]+)?/', $statement);



        return new EloquentStatement('update', null, $columns);

    }