Skip to content

Instantly share code, notes, and snippets.

@nfort
Created November 30, 2014 13:39
Show Gist options
  • Save nfort/318fb5d1a531ba855c42 to your computer and use it in GitHub Desktop.
Save nfort/318fb5d1a531ba855c42 to your computer and use it in GitHub Desktop.
Extracting information from a log file
<?
$text = "W/dalvikvm( 1553): threadid=1: uncaught exception
E/( 1553): FATAL EXCEPTION: main
E/( 1553): java.lang.StringIndexOutOfBoundsExceptio
E/( 1553): at widget.List.makeView(ListView.java:127)
E/( 1553): at widget.List.fillDown(ListView.java:622)
E/( 1553): at widget.List.fillFrom(ListView.java:709)";
$pattern = "/([a-z]+\w+).(\w+\.\w+):(\d{3,})./";
preg_match_all("/([a-z]+\w+).(\w+\.\w+):(\d{3,})./", $text, $output_array, PREG_SET_ORDER);
print_r($output_array);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment