When regular expressions switched to a UText based implementation, text indexes moved up to 64 bits. Much old 32 bit API remains for back compatibility.
Checking for overflow when going down to 32 bits is hit and miss. The whole thing should be reviewed, tests added, etc.
UText itself has possible problems with utext_replace() and utext_extract() returning 32 bit lengths. Behavior on overflow needs to be verified.