Does anyone know how to search a text file for just alphanumeric words using regex? And could you show me?
JackDurden
0
Junior Poster in Training
Recommended Answers
Jump to PostIt depends on what you want to do with the code.
If you want a vector of all the words or a particular one
Try thisstd::string Text; // set text equal to something ... std::string searchString="(\\S+)\\s"; boost::regex Re(searchString); std::vector<std::string> Aout; boost::regex_split(std::back_inserter(Aout), Text, Re); // Destroys Text …
All 3 Replies
StuXYZ
731
Practically a Master Poster
JackDurden
0
Junior Poster in Training
StuXYZ
731
Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.