preg_replace

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         }




        $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $params['url']);

        assert(is_string($url));



        $url = parse_url($url);
<?php     final public function escapeStringForLike(string $inputString, string $escapeChar): string

    {

        return preg_replace(

            '~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') . '])~u',

            addcslashes($escapeChar, '\\') . '$1',

            $inputString

        );

    }
<?php         if (strtolower($tableColumn['type']) === 'varchar' || strtolower($tableColumn['type']) === 'bpchar') {


            $length                = preg_replace('~.*\(([0-9]*)\).*~', '$1', $tableColumn['complete_type']);

            $tableColumn['length'] = $length;

        }
<?php             return null;

        }



        $comment = preg_replace('{^\s*--}m', '', rtrim($match[1], "\n"));



        return $comment === '' ? null : $comment;

    }
<?php             return null;

        }



        $comment = preg_replace('{^\s*--}m', '', rtrim($match[1], "\n"));



        return $comment === '' ? null : $comment;

    }