Skip to content

Instantly share code, notes, and snippets.

@cythrawll
Forked from joubertredrat/gist:7894852
Last active December 30, 2015 22:38
Show Gist options
  • Save cythrawll/7895074 to your computer and use it in GitHub Desktop.
Save cythrawll/7895074 to your computer and use it in GitHub Desktop.
<?php
$str = '[0710:020602938:7041]';
switch(1) {
case preg_match('/^(\[)[A-Z0-9]{4}:(' . rand(10000,29999) . '|' . rand(50000,99999) . '):[A-z]{3}(\])(.*)+/', $str):
/* ... */
break;
case preg_match('/^(\[)[A-Z0-9]{4}:[0-9]{9}:[0-9]{4}(\])+/', $str):
/* ... */
break;
default:
/* ... */
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment