With the exception of the fact that your code uses regex, what, if any, difference is there between what I posted and what you posted? If there isn't any, why would your code be preferable?

Just curious.