Regex replace to remove unused syntax