Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse regex_match();
Eclipse regex_match(); [message #1751121] Wed, 04 January 2017 15:18 Go to next message
Maciej Kowalski is currently offline Maciej KowalskiFriend
Messages: 1
Registered: January 2017
Junior Member
Hi, I'm trying to implement regex in my parser program when i used codeblocks all worked fine, on eclipse neon i have error Function 'regex_match' could not be resolved . I added flag to gcc c++ compiler settings -std=c++11 and checked CDT GCC Built-in compiler settings MiniGW.
How to make it work on eclipse ?

#include "ParserSip.h"
#include <regex> //its included ok

void checkIfCseq (SipMessage & pointer, string stringLine){
string stringToFind = ".*CSeq:.*";
regex_match(); // Function 'regex_match' could not be resolved
Re: Eclipse regex_match(); [message #1751284 is a reply to message #1751121] Sat, 07 January 2017 00:20 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 407
Registered: June 2014
Senior Member
after changing the c++ flags, can you try rebuilding the index:

1) Right-click on project
2) Select Index
3) Choose rebuild

Re: Eclipse regex_match(); [message #1751292 is a reply to message #1751284] Sat, 07 January 2017 08:17 Go to previous message
David VavraFriend
Messages: 1430
Registered: October 2012
Senior Member
There is no parameterless function std::regex_match() .

#include <regex>

void Func () {
  std::string s("subject");
  std::regex e ("(sub)(.*)");
  std::regex_match();	                            // <--- ERROR: no such function
  if (std::regex_match (s,e))                       // <--- OK
      std::cout << "string object matched\n";

  if ( std::regex_match ( s.begin(), s.end(), e ) ) // <--- OK
      std::cout << "range matched\n";
You may still need to rebuild the index after including <regex> though.

[Updated on: Sat, 07 January 2017 08:33]

Report message to a moderator

Previous Topic:BUG Eclipse Neon
Next Topic:A default .gdbinit file for Eclipse CDT(neon)/MingW on Windows
Goto Forum:

Current Time: Fri May 27 13:39:28 GMT 2022

Powered by FUDForum. Page generated in 0.02274 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top