jamescasbon/PyVCF — pull request #51 by lennax (2012-06-16 19:36:19+00:00)
Title: Make metadata RE reluctant (stop on first = not last)

Thanks to @dzerbino for many fixes. The metadata hash added here: https://github.com/jamescasbon/PyVCF/commit/d928de1cbe6fdc056aaafb723dd9644d8c760dd3#L2R170
fixed mis-parsing contigs with internal =, but a UnifiedGenotyper metadata line isn't wrapped in angle brackets and is thus still parsed improperly.

This is a very simple tweak to the RE:

(.+)=(.+) will put everything up to the very **last** = in the first group because + is greedy by default.

(.+?)=(.+) makes the + reluctant, so only the first group of characters that are not =, aka the key, will be in the first group.