but this won't strip duplicate `_`?

`var_dump(preg_replace('/[^\w_]+/', '_', 'hallo-_-123')); // -> 'hallo___123'`