Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Perform a regular expression search and replace
<?php preg_replace(    string|array $pattern,    string|array $replacement,    string|array $subject,    int $limit = -1,    int &$count = null): string|array|null
<?php         $content = str_replace(["\r\n", "\r"], "\n", $content);



        if ($strip_dashes) {

            $content = preg_replace('/^(\s*)-\s*/m', '\1', $content);

        }



        $content = preg_replace_callback(
<?php     public static function extractOptions($definition)

    {

        $options = explode(',', preg_replace('/enum\((?P<options>(.*))\)/', '$1', $definition));



        return array_map(

            function ($option) {
<?php     private function pretty_print_array(array $data, $assoc = true)

    {

        $output = var_export($data, true);

        $output = preg_replace('/^\s+/m', '        ', $output);

        $output = preg_replace(['/^array\s\(/', '/\)$/'], ['[', '    ]'], $output);



        if (!$assoc) {
<?php     {

        $output = var_export($data, true);

        $output = preg_replace('/^\s+/m', '        ', $output);

        $output = preg_replace(['/^array\s\(/', '/\)$/'], ['[', '    ]'], $output);



        if (!$assoc) {

            $output = preg_replace('/^(\s+)[^=]+=>\s+/m', '$1', $output);
<?php         $output = preg_replace(['/^array\s\(/', '/\)$/'], ['[', '    ]'], $output);



        if (!$assoc) {

            $output = preg_replace('/^(\s+)[^=]+=>\s+/m', '$1', $output);

        }



        return trim(str_replace("\n", PHP_EOL, $output));
<?php                 if (is_null($modifierAttributes)) {

                    $modifiers[] = self::$modifiers[strtolower($value)];

                } else {

                    $modifiers[] = [self::$modifiers[strtolower($value)] => preg_replace('~^[\'"]?(.*?)[\'"]?$~', '$1', $modifierAttributes)];

                }

            }

        }