I need to extract the data between the <span> tags and put it in a bidimensional array of [3][300]. With "1", "enchanted" and "chocolate bar" on the first vertical row, for example. How do I do that? Thank you!
Basically, "ooookiig", "krakaka" and "gagaga" are not important at all.
I just want to get the number between <span class="ooookiig"> and </span>, and then get the word between <span class="krakaka"> and </span>, and so on. I just don't know how it's done.
If you really need to use C++ to do this (and there are *much* better languages to do this sort of processing in) then either use an XML parser such as Xerces or use the Boost Regex Library.
If this is a class assignment where your teacher is trying to show you, intentionally or not, how not to use C++ (the fixed array is usually a giveaway), you are SOL. Bite the bullet and use the string functions R0mai suggests.
Bazzy, you don't get out much, do you? I go crazy when I have to do serious text processing in C++ without third-party libraries. There are lots of other languages that excel at text processing natively. (I would reach for Python, but there are plenty others.) Few would say that C++ excels at text processing, though with the help from third-party libraries it is getting there.
Here is what I mean: I know I can write a DFA regex parser in C++ that will be fast as all get out. But when I want to do text processing, I want to forget about low-level details and write code that deals with the domain of parsing text, not the domain of text parsers.