3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<pre><?php $file = " # Dump File # Database is ported from MS Access CREATE DATABASE IF NOT EXISTS `movedb`; # Table structure for table 'test_prefixSwitchboard Items' DROP TABLE IF EXISTS `test_prefixSwitchboard Items`; CREATE TABLE `tbl` ( `x` INTEGER NOT NULL, `y` INTEGER NOT NULL DEFAULT 0, `z` VARCHAR(255) ) ENGINE=innodb DEFAULT CHARSET=utf8; SET autocommit=1; # # Dumping data for table 'Switchboard Items' # INSERT INTO `tbl` ( `x`, `y`, `z`) VALUES ( '111' , '111' ,'111'); INSERT INTO `tbl` ( `x`, `y`, `z`) VALUES ( '222' , '2222' ,'222'); INSERT INTO `tbl` ( `x`, `y`, `z`) VALUES ( '333' , '333' ,'333'); "; preg_match_all( '/`tbl`.*?VALUES\s+\(\s+(.*?)(?=\);\s*$)/', $file, $matches); foreach( $matches[1] as $match) echo $match . "\n";;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>'333' , '333' ,'333'