I put this patch in, since it is clearly correct regardless of regex-specific questions. I'd like Isamu to respond on the general questions about allocation in regex.