Help for this page

Select Code to Download


  1. or download this
    my ($y) = '/a/b/c/d/e/f' =~ m{^(/[^/]+/[^/]+/[^/]+)};
    
  2. or download this
    my $y = join('', (split(qr{(?=/)}, '/a/b/c/d/e/f'))[0..2]);