in reply to Regex problem

Consider Parse::RecDescent.