Quoth l...@gnu.org (Ludovic Courtès): > Hello, > > Sebastian Tennant <seb...@smolny.plus.com> writes: > >> (info "(guile-1.8)Regexp Functions") >> >> "Zero bytes (`#\nul') cannot be used in regex patterns or input >> strings, since the underlying C functions treat that as the end of >> string. If there's a zero byte an error is thrown." > > I think it makes sense to explicitly restrict regexps to actual text as > opposed to binary data.
On second thoughts, I'm not so sure... shouldn't users have the option (either at compile time, or better still, in userland)? Restricting regexps to actual text is fine... until you need to grep binary data, or, as in this case, a combination of text and binary data. I thought it was going to be trivial to replace the call to regexp-exec in cgi.scm that extracted the uploaded (possibly binary) file, because the pattern identifying the beginning of the file in the raw data string is simple ("\n\r\n\r") - but I now realise that many calls to regexp-exec in cgi.scm will need to be replaced, some with complex matching patterns, so I can't see how this can be done without using regexps, hence my changed opinion. The only thing I can think of doing now is replacing calls to regexp-exec with system calls to grep (which can accept binary data) - clearly sub-optimal and non-trivial. Anyone have any other ideas? How easy would it be to build a guile with a regex feature that doesn't implement this restriction on binary data? Seb -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap