12 Replies Latest reply on Dec 11, 2015 4:47 PM by CMata_Intel

    Edison Eclipse C++ Regex does not exist

    Keith.M

      Hi,

       

      I'm attempting to use regex_replace in my program, but when I try to do it the standard C++ way, I get errors.

       

      I have 'using namespace std;' at the top of my file, and my code I'm trying to compile is:

       

        //returns the output of the battery-voltage command on the edison, something like "Battery Voltage = 4010 mV\nBattery level = 68%"

        std::string battery = getCmdOutput("battery-voltage");

         //regex is suppose to filer out everything except the mV reading in the first line

        std::regex batmVReg("(Battery\ Voltage\ =\ )|(\ mV)");

        int batmV = std::regex_replace(battery, batmVReg, "\n");

       

      It's telling me that "'regex' is not a member of std" and "function 'regex_replace' could not be resolved". Is there a different way to go about doing regex in Eclispe For Edison?