error_get_last() doesn't show last warning
Use the same PHP's error functions as Drupal to toggle PHP's error handling behavior. 

In particular, you can use set_error_handler() / restore_error_handler() to toggle the PHP error code handling while you're debugging:

// Remove _drupal_error_handler() handling
restore_error_handler();

if (@preg_match($regex, NULL) === FALSE) {
  dpm(error_get_last());
}
// Restore _drupal_error_handler() handling
set_error_handler('_drupal_error_handler');


See the PHP doc links for more information on how these error handling functions work.