regex to parse layout string. Recursively works.