diff.c: associate a flag with each pattern and use it for compiling regex