# HG changeset patch # User František Kučera # Date 1621802385 -7200 # Node ID fc8b94bccfc5f719f602f11db71e659c5132007d # Parent b8f130c7998e12fefd77484297d9908e0a74c278 DataMode: support also negative integers + back to the correct value index diff -r b8f130c7998e -r fc8b94bccfc5 src/DataMode.h --- a/src/DataMode.h Sun May 23 21:32:37 2021 +0200 +++ b/src/DataMode.h Sun May 23 22:39:45 2021 +0200 @@ -36,7 +36,7 @@ std::vector values; bool matches(int attributeIndex, const std::wregex& pattern) { - for (int record = 0, attributeCount = attributes.size(), limit = values.size() / attributeCount; record < limit; record++) if (!std::regex_match(values[record * attributeIndex], pattern)) return false; + for (int record = 0, attributeCount = attributes.size(), limit = values.size() / attributeCount; record < limit; record++) if (!std::regex_match(values[record * attributeCount + attributeIndex], pattern)) return false; return true; } @@ -81,7 +81,7 @@ }; const std::wregex DataMode::BOOLEAN_PATTERN = std::wregex(L"true|false"); -const std::wregex DataMode::INTEGER_PATTERN = std::wregex(L"[0-9]+"); +const std::wregex DataMode::INTEGER_PATTERN = std::wregex(L"-?[0-9]+"); } }