<?php $str = 'test-213-test-example-demo-1a-3321-0-3555-0'; echo trim(preg_replace('/[^\d-]+|\d+\pL+/', '', $str), '-');
You have javascript disabled. You will not be able to edit any code.