regexp: Avoid integer overflow and OOB array access Limit size of 2D arrays to XML_MAX_ITEMS (1e9) to avoid overflow of int indexes. Fixes #950.