<?php $str = 'J2123409871111222';preg_match_all('/(.)(\d{4})(\d{4})(\d{4})(\d{4})/', $str, $matches, PREG_SET_ORDER, 0);print_r($matches);
Standard input is empty
Array ( [0] => Array ( [0] => J2123409871111222 [1] => J [2] => 2123 [3] => 4098 [4] => 7111 [5] => 1222 ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!