fork(1) download
  1. <?php
  2.  
  3. $re = '~/([^/]+)~';
  4. $str = "/test:n(0-2)/div/";
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches[1]);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => test:n(0-2)
    [1] => div
)