I have a version file I need to parse to get certain versions in C99. For example purposes, say one of the strings looks like this:
FILE: EXAMPLE ABC123459876-001 REV 1.IMG
The 12345 numbers can be any arbitrary numbers, but always followed by 4 digits and a hyphen + a rev and an extension. I just want to return the middle of this string, that is, the file name + main version so: "EXAMPLE 9876-001 REV 1". I got it to work in the regex101 tester online with something like:
"(?<=EXAMPLE ABC.....)(....-... REV .)(?=.IMG)"
... but C99 regex does not support positive lookahead / lookbehind operators so this does not work for me. Should I be using strstr() or strtok() instead? Just looking for some ideas as to the best way to be doing this in C, thanks.