Extracting regex submatch boundaries without backtracking
It occurred to me after I made this post that I could store the states in a linked list format:
typedef struct stateRecord {
    struct stateRecord *next;
    size_t state;
    size_t startIdx;
    size_t endIdx;
} stateRecord;