<?php $str = "test-test-3test-1";preg_match('/\ntest-(.*)$/mi', $str, $match);var_dump($match);
Standard input is empty
array(2) { [0]=> string(7) " test-1" [1]=> string(1) "1" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!