Regulare expressions to the rescue.