Do not use a single regex for this and instead build a proper parser with mgc parsing. You can check this module for prior art along those lines:

https://metacpan.org/source/MITHALDU/Locale-Simple-0.017/lib/Locale/Simple/Scraper/Parser.pm

It is based on Parser::MGC, which is very useful for this kind of task.

--
With regards,
Christian Walde

Reply via email to