Clarify "breaker" -> regex "pattern"
This commit is contained in:
parent
710807dde7
commit
bddc486aeb
@ -74,8 +74,8 @@ void graph::read(std::string filename) {
|
|||||||
|
|
||||||
std::vector<int> stovi (const std::string &s) {
|
std::vector<int> stovi (const std::string &s) {
|
||||||
// Create the number classifier
|
// Create the number classifier
|
||||||
std::regex breaker("[0-9]+");
|
std::regex pattern("[0-9]+");
|
||||||
std::sregex_token_iterator first{s.begin(), s.end(), breaker, 0}, last;
|
std::sregex_token_iterator first{s.begin(), s.end(), pattern, 0}, last;
|
||||||
// Match the numbers
|
// Match the numbers
|
||||||
std::vector<int> res;
|
std::vector<int> res;
|
||||||
for (auto i = first; i != last; ++i) res.push_back(atoi(i->str().c_str()));
|
for (auto i = first; i != last; ++i) res.push_back(atoi(i->str().c_str()));
|
||||||
|
Loading…
Reference in New Issue
Block a user