Ronak Aggarwal
Ronak Aggarwal

Reputation: 1

Implementing Regular Expression in C++

I want to make a c++ program to match particular regular expressions, I used DevCpp and the library

#include<regex.h>

. It's not working, I don't know why.

It's showing: [Error] regex.h: No such file or directory

Upvotes: 0

Views: 308

Answers (1)

Alan Birtles
Alan Birtles

Reputation: 36379

The headers from the C++ standard library don't have .h on the end. In this case the correct include is:

#include <regex>

You also need to ensure that your compiler supports c++11. In the case of GCC you need to be careful that you are using a recent version (4.9 or newer), libstdc++ provided a regex header long before they had provided a working implementation.

Upvotes: 2

Related Questions