pub function for parsing a string as CGI