It is because escaping backslashes did not cure my problem that I posted. [Doing this in both places may allow me to compile without warnings, but the Regex action fails.] Let me explain more.
escape as you suggest and my build error is:
Building Gold In Console.obj.
C:\SGV1\C _Regex Dev\Gold In Console\Gold In Console.c(26): warning #2176: Unrecognized character escape sequence '\.'.
Building Gold In Console.exe.
Done.
I had tried this, trying to see what it took to get rid of the warnings.
In my "real-life use" I will be of course checking user input, if the user input "C:\Folder" correctly ..... there will be only one backslash there and that is what I will be verifying with Regex. ..... but this is tangential to this issue.
Also I knew that if I escaped the backslash here also:
strcpy(buf , "[A-C]:\\."); //...................... The dot means any character(s).
It would build without warnings..... HOWEVER:
It no longer matched, as it should.
I do not know if it is my computer, a corrupt install, or if other people will see the same thing.
That is why I posted. I do not understand why I see what I see.
Thanks for the reply.
If you knew that your suggestion would correct things (by building) then I assume .....you would have said so.
Did you try it?
Because if it works for you: .......... i.e. you can build without warnings, yet have the Regex work properly .....then I have a problem of another sort here.
---Ed