diff --git a/src/Nibbler.cpp b/src/Nibbler.cpp index 48b0d928d..cfd2291f9 100644 --- a/src/Nibbler.cpp +++ b/src/Nibbler.cpp @@ -762,33 +762,6 @@ bool Nibbler::skipWS () return this->skipAllOneOf (" \t\n\r\f"); } -//////////////////////////////////////////////////////////////////////////////// -#ifdef NIBBLER_FEATURE_REGEX -bool Nibbler::skipRx (const std::string& regex) -{ - if (_cursor < _length) - { - // Regex may be anchored to the beginning and include capturing parentheses, - // otherwise they are added. - std::string modified_regex; - if (regex.substr (0, 2) != "^(") - modified_regex = "^(" + regex + ")"; - else - modified_regex = regex; - - RX r (modified_regex, true); - std::vector results; - if (r.match (results, _input->substr (_cursor))) - { - _cursor += results[0].length (); - return true; - } - } - - return false; -} -#endif - //////////////////////////////////////////////////////////////////////////////// bool Nibbler::backN (const int quantity /*= 1*/) { diff --git a/src/Nibbler.h b/src/Nibbler.h index 4258edda4..6be76976f 100644 --- a/src/Nibbler.h +++ b/src/Nibbler.h @@ -80,9 +80,6 @@ public: bool skipAll (char); bool skipAllOneOf (const std::string&); bool skipWS (); -#ifdef NIBBLER_FEATURE_REGEX - bool skipRx (const std::string&); -#endif bool backN (const int quantity = 1); diff --git a/test/nibbler.t.cpp b/test/nibbler.t.cpp index 3c7e819d9..6fa1d3da2 100644 --- a/test/nibbler.t.cpp +++ b/test/nibbler.t.cpp @@ -176,17 +176,6 @@ int main (int, char**) t.is (s, "foo", " 'foo' : getUntilEOS () -> 'foo'"); t.ok (n.depleted (), " '' : depleted () -> true"); -#ifdef NIBBLER_FEATURE_REGEX - // bool skipRx (const std::string&); - t.diag ("Nibbler::skipRx"); - n = Nibbler ("one two"); - t.ok (n.skipRx ("o."), " 'one two' : skipRx ('o.') -> true"); - t.notok (n.skipRx ("A+"), " 'e two' : skipRx ('A+') -> false"); - t.ok (n.skipRx ("e+"), " 'e two' : skipRx ('e+') -> true"); - t.ok (n.skipRx ("...."), " ' two' : skipRx ('....') -> true"); - t.ok (n.depleted (), " '' : depleted () -> true"); -#endif - // bool backN (const int quantity = 1); t.diag ("Nibbler::backN"); n = Nibbler ("/a/b/");