[ create a new paste ] login | about

Link: http://codepad.org/9rmTLRQA    [ raw code | output | fork ]

PHP, pasted on Oct 7:
1
2
3
4
5
6
7
8
9
10
<?php
var_dump(
    preg_split(
        '/(\d+|[^\/\d]+)\/?/',
        '33A/5',
        -1,
        PREG_SPLIT_DELIM_CAPTURE |
        PREG_SPLIT_NO_EMPTY
    )
);


Output:
1
2
3
4
5
6
7
8
array(3) {
  [0]=>
  string(2) "33"
  [1]=>
  string(1) "A"
  [2]=>
  string(1) "5"
}


Create a new paste based on this one


Comments: