From d2898b845671f5d5c836b1d2c7dc5e38b4ffab55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lais=20Frig=C3=A9rio?= <lfs@inf.ufpr.br> Date: Mon, 30 Jan 2017 08:46:02 -0200 Subject: [PATCH] Replace regex fuctions to libre2 --- src/linux/datasid-parse.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/linux/datasid-parse.cpp b/src/linux/datasid-parse.cpp index 85ec8d13..7fd8a42c 100644 --- a/src/linux/datasid-parse.cpp +++ b/src/linux/datasid-parse.cpp @@ -100,23 +100,19 @@ bool isValid(std::string* line) { std::string str(s); // re2::StringPiece input(str); - re2::RE2 re("((\\/\\/)|(\\/\\*)|(\\#))(.*)"); - - // assert(RE2::FullMatch("ruby:1234", "(\\w+):(\\d+)", &s, &i)); - // assert(s == "ruby"); - // assert(i == 1234); + // re2::RE2 re("((\\/\\/)|(\\/\\*)|(\\#))(.*)"); normalize(line); /* if the line is a comment */ -// if(std::regex_match((*line),std::regex("((\\/\\/)|(\\/\\*)|(\\#))(.*)"))) - // return false; + if (RE2::FullMatch(s, "((\\/\\/)|(\\/\\*)|(\\#))(.*)")) + return false; /* if the line start with a different character than quote */ - // if (!std::regex_match((*line), std::regex("(\")(.*)"))) - // return false; + if (!RE2::FullMatch(s, "(\")(.*)")) + return false; /* * if the line start with quote, -- GitLab