Skip to content

Instantly share code, notes, and snippets.

<?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;