Mutli-mode mode
Posted: Fri May 26, 2006 5:55 pm
Well I thought I had it fixed..... 
Now I have this block of SQL and I need to match the very top line and the very last character on the last line
So I know I need to use the 'm' modifier after the pattern delimiter to put it into multi-line mode, but what I dont know is the operator or character that signals the end and beinning of the block ($ ^ only work for the lines, not blocks now in multiline mode).
Ex. preg_match("/[CHARACTER FOR BEGINNING OF BLOCK HERE]CREATE TABLE[[:space:]]$table [CHARACTER FOR END OF BLOCK HERE];/im")
And the SQL is like this...
CREATE TABLE `nuke_topics` (
`topicid` int(3) NOT NULL auto_increment,
`topicname` varchar(20) default NULL,
`topicimage` varchar(100) default NULL,
`topictext` varchar(40) default NULL,
`counter` int(11) NOT NULL default '0',
PRIMARY KEY (`topicid`),
KEY `topicid` (`topicid`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
Except there are 30 other commands like it, but Im trying to find the one that has the table name in the first line
Thanks a bunch
Now I have this block of SQL and I need to match the very top line and the very last character on the last line
So I know I need to use the 'm' modifier after the pattern delimiter to put it into multi-line mode, but what I dont know is the operator or character that signals the end and beinning of the block ($ ^ only work for the lines, not blocks now in multiline mode).
Ex. preg_match("/[CHARACTER FOR BEGINNING OF BLOCK HERE]CREATE TABLE[[:space:]]$table [CHARACTER FOR END OF BLOCK HERE];/im")
And the SQL is like this...
CREATE TABLE `nuke_topics` (
`topicid` int(3) NOT NULL auto_increment,
`topicname` varchar(20) default NULL,
`topicimage` varchar(100) default NULL,
`topictext` varchar(40) default NULL,
`counter` int(11) NOT NULL default '0',
PRIMARY KEY (`topicid`),
KEY `topicid` (`topicid`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
Except there are 30 other commands like it, but Im trying to find the one that has the table name in the first line
Thanks a bunch