We inherited from TRE regexec code that's utterly wrong with respect to the integer types it's using; while it doesn't appear to be unsafe, it fails to find matches past offset INT_MAX. This patch fixes the type of all variables/fields used to store offsets in the string from int to regoff_t, and seems to fix the problem, though it has not been heavily tested yet. I've also attached a test program suitable for demonstrating the bug and at least one case where the fix works. It uses my (also attached) alloc_huge function which allows testing >4GB inputs to string functions without the need for huge amounts of physical memory or swap. Rich