Revised regex to recursive for nested matches