$re = '/^(^\s*\bput\s)((?!\sinto\s).)*$/m';
$str = 'on mouseUp
put 10 into tFoo
put "added 10"
put tFoo + 5 into tBar
put "the answer is" & tBar
putMessage "the answer " & tbar & " was put into tBar"
putMessage "the above line should not be matched."
put tBar * 2 into tBar
put "tBar is" && tBar into field "answer"
put "\'This line should be matched\', he intoned."
put "This should be matched but having into here means this is not matched"
end mouseUp
on putMessage pMessage
if pMessage is not empty then
put "message:" & pMessage
end if
end putMessage
';
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