Skip to content

Instantly share code, notes, and snippets.

@cdglove
Created March 29, 2015 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdglove/ce7c4df4d5aadf1697e9 to your computer and use it in GitHub Desktop.
Save cdglove/ce7c4df4d5aadf1697e9 to your computer and use it in GitHub Desktop.
void xpressive_csv(std::string raw_csv, std::set<std::string>& dest_set)
{
using namespace boost::xpressive;
sregex re = +(+alnum);
std::transform(
sregex_iterator(raw_csv.begin(), raw_csv.end(), re),
sregex_iterator(),
std::inserter(dest_set, dest_set.begin()),
[](smatch const& match)
{
return match[0];
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment