Jun 18, 2018 at 4:06pm
This is just a thought, but if you were replacing words with regex and you wanted to count how many words you replaced then how would you do that?
Jun 18, 2018 at 4:15pm
https://duckduckgo.com/?q=regex+count+occurrences&t=ffsb&ia=qa
Jun 18, 2018 at 5:39pm
it might be easier to read (and write, and debug, etc) if you do a count-if though?
Last edited on Jun 18, 2018 at 5:39pm
Jun 19, 2018 at 5:56am
@Thomas1965 "Why don't you use a stringstream or even strtok to split replace and count ?"
I haven't heard of them.
Jun 19, 2018 at 7:30am
Stringstreams are very useful so you should have a look at them.
For this task maybe stick with regex.
Jun 19, 2018 at 1:22pm
Ok thanks for the tip, I'll check them out.