3v4l.org

run code in 200+ PHP versions simultaneously
<?php foreach(array( 'localhost/web/category/finanzas/page/2/', 'localhost/web/category/finanzas/page/3/', 'localhost/web/category/finanzas/page/2000/', 'localhost/web/category/finanzas/' ) as $val) { echo preg_replace('/page\/\d+\//', '', $val); echo "\n"; }
based on 5DeWm
Output for 5.6.0 - 7.4.0
localhost/web/category/finanzas/ localhost/web/category/finanzas/ localhost/web/category/finanzas/ localhost/web/category/finanzas/