Improved function for BUFR rawtext parsing