I would like to parse binary files with PCRE. My tactic until now was to use fgets
to read a line of a file, then parse that line using pcre_exec
.
This will not work for me now because the "lines" end with a null byte rather than a newline. I did not see a way to have fgets
stop at a null byte rather than newline.
Edit
The functionality would be similar to running grep -az PATTERN FILE