I want to use libpcre2 to match substrings in plain text files, but libpcre2 does not provide: pcre2_match_file() or pcre2_match_fd() API. It seems that I need to open the file myself and take each line and pass it to the pcre2_match() function in turn?
I am not sure if I should do this.
Is there a higher performance way besides this? For example using mmap() to map files to memory?
I only tried matching a buffer and wanted to expand to match an entire plain text file.
#include <pcre2.h>
int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options, pcre2_match_data *match_data, pcre2_match_context *mcontext);