3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "({max_w} * {max_h} * {key|value}) / {key_1|value}"; $pattern = "/{\K[^{}|]*\|[^{}|]*(?=})/"; preg_match_all($pattern, $str, $matches); print_r($matches[0]);

preferences:
79.66 ms | 1344 KiB | 5 Q