add function parse_begin which parses only the start of the string