php如何为以下字符串创建正则表达式

I have the following text format that I want to create a regular expression for preg_replace. I want to create a pattern for the text below that start -- MySQL and end with KEYS */;

I need the regular expression to replace this part of a hundred files with the following text.

I tried the following but seems wrong

$st = get_file_content(file1.sql);
$string = preg_replace("@^-- MySQL.*KEYS \*\/;$@","",$st);

-- MySQL dump 10.13  Distrib 5.1.70, for unknown-linux-gnu (x86_64)
--
-- Host: localhost    Database: phoneinf_phonedb
-- ------------------------------------------------------
-- Server version   5.1.70-cll

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `tbl_phonecomment`
--

DROP TABLE IF EXISTS `tbl_phonecomment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tbl_phonecomment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `phonenumber` varchar(20) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `comment` text NOT NULL,
  `dateposted` int(11) NOT NULL,
  `area` varchar(4) NOT NULL,
  `prefix` varchar(4) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `phonenumber` (`phonenumber`),
  KEY `area` (`area`,`prefix`)
) ENGINE=MyISAM AUTO_INCREMENT=38410310 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tbl_phonecomment`
--
-- WHERE:  1 limit 6574790,50000

LOCK TABLES `tbl_phonecomment` WRITE;
/*!40000 ALTER TABLE `tbl_phonecomment` DISABLE KEYS */;

@-- MySQL.*KEYS \*/@

It would appear some of the characters were eaten by StackOverflow. I think that should be fixed now.

try this

/^-- MySQL\..*KEYS */;$/

It would be better, however, to use the string manipulation functionality of whatever programming language you're using to slice off the first four and the last three characters of the string and check whether they're what you want.