I am trying to parse a wikipedia page and need to extract a particular section of the page using regex. In the below data, I just need to extract the data inside {{Infobox...}} section.
{{Infobox XC Championships
|Name = Senior men's race at the 2008 IAAF World Cross Country Championships
|Host city = [[Edinburgh]], [[Scotland]], [[United Kingdom]] {{flagicon|United Kingdom}}
|Location = [[Holyrood Park]]
|Nations participating = 45
}}
2008.<ref name=iaaf_00>
{{ Citation
| last =
| publisher = [[IAAF]]
}}
So in the above example, i need to extract only
Infobox XC Championships
|Name = Senior men's race at the 2008 IAAF World Cross Country Championships
|Host city = [[Edinburgh]], [[Scotland]], [[United Kingdom]] {{flagicon|United Kingdom}}
|Location = [[Holyrood Park]]
|Nations participating = 45
Please note that there might be nested {{ }} characters within {{Infobox...}} section. I don't want to omit that.
Below is my regex:
\\{\\{Infobox[^{}]*\\}\\}
but it doesn't seem to work. Please help. Thanks!