Part of my intro to CS class is access to "my programming lab" which is a collection of questions relating to the text. This question is supposed be related to section 6.1 of Savitch's "Problem Solving with C++". The section is titled "Why use files for I/O?" and has nothing to do with strings. I can't find any mention of anything like this in the text, anywhere. Since I'm new to C++, I could just be missing the key words.
The question:
Which string does NOT match the regular expression: "v.x.*"?
v.x.*
vx
v.x
vxxxxxxx
vvx
Through trial and error I get the answer to be "vx". I do not understand this at all from my experience with wildcards in DOS, Unix, etc. Please educate me!
You are correct, because v.x.* requires a minimum of three characters to match.
The first character must be a 'v'. v
The second character can be anything. .
The third character must be an 'x'. x
Zero or more of any characters may follow. .*