better regex with replacement with pm_id