3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "#^([^|]+)\|(\d+)([^|]+)\|(\d+)$#m"; $string = "Product 1|200Producht 392|150\nProduct 2|400Producht 592|250"; $matches = array(); $search = preg_match_all($pattern, $string, $matches, PREG_SET_ORDER); print_r($matches);

preferences:
52.21 ms | 402 KiB | 5 Q