Replace std::regex with boost::regex

std::regex doesn't work in older GCC version (#532)
master
Piotr Dziwinski 2015-07-25 09:10:11 +02:00
parent 4e836fa1d8
commit a5ff361bcc
1 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@
#include "ui/window.h"
#include <regex>
#include <boost/regex.hpp>
@ -416,12 +416,12 @@ bool CAutoFactory::EventProcess(const Event &event)
CBrain* brain = dynamic_cast<CProgrammableObject*>(vehicle)->GetBrain();
Program* program = brain->AddProgram();
if (std::regex_search(m_program, std::regex("^[A-Za-z0-9_]+$"))) // Public function name?
if (boost::regex_search(m_program, boost::regex("^[A-Za-z0-9_]+$"))) // Public function name?
{
std::string code = "extern void object::Start_"+m_program+"()\n{\n\t\n\t//Automatically generated by object.factory()\n\t"+m_program+"();\n\t\n}\n";
program->script->SendScript(code.c_str());
}
else if (std::regex_search(m_program, std::regex(".txt$"))) // File name (with .txt extension)?
else if (boost::regex_search(m_program, boost::regex(".txt$"))) // File name (with .txt extension)?
{
program->script->ReadScript(m_program.c_str());
}