You assert that pattern is not NULL and then you check if it is NULL? Assert'ing the return value from pcre_compile() is wrong.

BTW, what does StringMatchCaptures() mean? Name is unintuitive, I've been looking it 5 minutes, maybe comment/rename?