inspect: Move shared PCRE match functions to separate file.