Skip to content

Instantly share code, notes, and snippets.

@filsinger
Created October 18, 2012 09:06

Revisions

  1. filsinger created this gist Oct 18, 2012.
    8 changes: 8 additions & 0 deletions main.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #include <regex>
    #include <string>
    #include <vector>

    std::vector<std::string> Split(const std::string& str, const std::string& regex)
    {
    return {std::sregex_token_iterator(str.begin(), str.end(), std::regex(regex), -1), std::sregex_token_iterator()};
    }