import re


def extract_post_meta(tex):
    """
    Locate the first section of \postmeta{...} and return it.
    See the spec in parse_post_meta()
    """
    m = re.search('postmeta{(.+?)}\n', tex, re.DOTALL)
    if m:
        return m.group(1)
    return None