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