construct a dictionary from a buffer lines using specified regexes