1

How should i define the regex pattern, when i use the tr1/regex library?

#include <tr1/regex>

const regex pattern("[^-]-[^-]");

is not working... When compiling i get error: ‘regex’ does not name a type

1 Answer 1

3

regex is in the tr1 namespace so you either need to declare that you are using tr1 or specify that regex is in the tr1 namespace:

using namespace tr1;

or

const tr1::regex pattern("[^-]-[^-]");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.