$re = '/^(?!.*;\[\w\w\].*).*/mi';
$str = 'Sendinput, {f1}+{Insert}
Sendinput, {f1}+{Pause}
Sendinput, {f1}+{Home}
Sendinput, {f1}+{PgUp}
Sendinput, {f1}+{PgDn}
Sendinput, {f2}{a} ;[2r] [3D Model Tre]
Sendinput, {f2}{b} ;[3b] [Accessibility Checker ]
Sendinput, {f2}{c} ;[2z] [Accessibility Report r]
Sendinput, {f2}{d} ;[5r] [Attachments]';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php