Split on ; token instead of trying to capture submatches.

This commit is contained in:
Joseph Lenox 2018-07-04 12:48:39 -05:00 committed by Joseph Lenox
parent 1d63925bda
commit e4fd688c78

View File

@ -41,9 +41,9 @@ void UI_Point::_set_value(Slic3r::Pointf value) {
void UI_Point::_set_value(std::string value) { void UI_Point::_set_value(std::string value) {
/// parse the string into the two parts. /// parse the string into the two parts.
std::regex format_regex("([0-9.]+);([0-9.]+)"); std::regex format_regex(";");
auto f_begin { std::sregex_iterator(value.begin(), value.end(), format_regex) }; auto f_begin { std::sregex_token_iterator(value.begin(), value.end(), format_regex, -1) };
auto f_end { std::sregex_iterator() }; auto f_end { std::sregex_token_iterator() };
if (f_begin != f_end) { if (f_begin != f_end) {
auto iter = f_begin; auto iter = f_begin;