Since its a (recursive) loop in the regex code Geany can't do anything about it.
I suspect the library (PCRE) can't do anything about it either. You are simply asking for something that is too big for your available system stack, if you run the regex on a small file it will not crash because there is enough stack to do it.
But I doubt that regex is actually what you actually want to do anyway, making a capture for every character is unlikely to be what you want.