On Tue July 5 2005 05:41, Roberto Diaz wrote: > Hi. > > I have to parser some documents which contain some mime/multiparts > sections.. > > I haven't problems parsing most of the document using flex/bison the > problem is in the multipart sections. [...] > you see the boundary is dynamically defined so I can no use regular > expressions to detect the "--break".. this wouldn't be an issue at all > if I could use regular expressions to detect the bodies.. but this is > not the case for the text/plain parts. > > > Maybe some of you know about some trick.,.
You need some code to handle the situation. And a regular expression wouldn't help, because a boundary parameter can be quoted and/or encoded and/or split (see RFC 2231). You will also need to take into account missing closing delimiters (RFC 2046 section 5.1.2). There is a flex/bison/C solution at http://users.erols.com/blilly/mparse It's at alpha because it depends on reentrant flex which has been stuck at beta for years. _______________________________________________ Help-flex mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-flex
