Below is my code to test the regex iterator.
I use word = "h??"
and word2 = "him hey hot got".
However, it reaches an error with cout << *it;
This is how I learned to output it, so I can't figure out why it is giving errors. Any help is greatly appreciated!!
You seem to think that question marks mean "any character". That may be true in filename wildcards from the terminal, but in a regex a period means "any character". A question mark means "zero or one" of the preceding thing. So try entering "h.." and "him hey got hooray done" . It should print "him", "hey", "hoo".
Also, using >> with cin stops at the first space. Use getline to read a line.