Problem is, you are using sizeof instead of string length :
pcre_exec(recc, NULL, subject, sizeof(subject), 0, 0, ovcc, 9
^^^^^^^^^^^^^^^
It should be:
pcre_exec(recc, NULL, subject, strlen(subject), 0, 0, ovcc, 9
It runs in main() function where I think you uses sub
array it self and sizeof(sub)
gives number of chars + 1, but in function you sizeof(subjest)
== sizeof (char*)
in your system.