public static function searchAndReplace($search, $replace, $pathAndFilename, $regularExpression = false)
    {
        $pathInfo = pathinfo($pathAndFilename);
        if (!isset($pathInfo['filename']) || $pathAndFilename === __FILE__) {
            return false;
        }

        $file = file_get_contents($pathAndFilename);
        $fileBackup = $file;
        if ($regularExpression === true) {
            if ($replace instanceof \Closure) {
                $file = preg_replace_callback($search, $replace, $file);
            } else {
                $file = preg_replace($search, $replace, $file);
            }
        } else {
            $file = str_replace($search, $replace, $file);
        }
        if ($file !== $fileBackup) {
            file_put_contents($pathAndFilename, $file);
            return true;
        }
        return null;
    }