I'd use the regex approach if the input in question was generated from a known template that would never change, which means all the whitespace would always be in the sampe place. Or in a one-time script I'll never run again. Which makes it almost never. :-)