Hi i am new in this world, so i need some help with this. I need to make a program in c++ or c, receive an xml file, and the program count the file labels (<Home> <\Home>) and say how many time repeats the same label.


thanks for the tips bro. But now i'm having a little issue. by example i declare my regular expression like
string regex_str = "[a-z]+";
and in my file i have strings like


So in theory, the regular expression must recognize all expressions in letters between a and z, with all combinations. Interestingly only recognized when a single letter come, is like if my regular expression is [a-z] without +, if I try whit * the same thing happens only recognizes the letter alone. You have some recommendation for this

Maybe something like this: Click Here

You're explanation: yes, indeed, it has to match all characters between a-z, but, when it meets a blank space, it will stop, since ' ' is not part of the 'a-z' range.

Use '\b[what_to_search]\b' to search as words, since '\b' stands for word boundary, or try using this regex \w+ for matching only words, but this will match also digits.

This article has been dead for over six months. Start a new discussion instead.