The format of the citations on Wikipedia, by and large, follows one of two standard citation models, with the exciting names Citation Style 1 (https://en.wikipedia.org/wiki/Help:Citation_Style_1) and Citation Style 2 (https://en.wikipedia.org/wiki/Help:Citation_Style_2). These are easy to parse, when they are using the standard templates. Lesser used styles (Vancouver, LSA) should not be harder, just different.
Since Wikipedia is editable by anyone, and there is no mandatory style of referencing, partly because of battles, long long ago, you cannot expect to get 100% of the information you seek with a naive parser, however you can get a very high percentage, and the more effort you put in, the higher the percentage will be.
You can find code to help you in pywikibot (python) AWB (C#) and in various other places, such as Anomie's excellent perl bot code [https://en.wikipedia.org/wiki/User:AnomieBOT/source].
I would suggest any language you use have PCRE available, if you want to craft your own tools.
Also be aware that you can download XML dumps of Wikipedia articles in any language. If you want to get the references for a very large number (or all) articles, this will be a resource saver.
You should also look at Wikidata, which has an extensive bibliographic coverage of academic papers.
You can also look at various cite completion tools for code to borrow. Refill (https://en.wikipedia.org/wiki/User:Zhaofeng_Li/reFill) is a php tool that fills in missing details in references. Citation bot (https://en.wikipedia.org/wiki/User:Citation_bot) is also written in php, and has I believe a git repository.
If you have specific questions, you can ask me on my Wikipedia talk page, or ask other at any of the usual places (https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical), https://en.wikipedia.org/wiki/Wikipedia:Help_desk or Wikipedia:Bots/Noticeboard). Most people are pretty friendly.