fman
fman

Reputation: 230

regex_error. What's wrong with my regex

I'm getting regex_error for some reason. I also tried it the regular way of using escape characters (this method eliminates the need for escape sequences in c++ 11 by putting R"(something)" )

By the way if anyone was wondering, they are for recognizing lines in xml

When I use a web based regex tester it works fine.

string sstart = R"(\w*+(> ? +[^\\])++>)";
string send = R"(.*<\\\w\w[^m-o][^_]++)";
string sdata = R"([^>]++>[^ ]++)";

regex endtag(send);
regex taganddata(sdata);
regex starttag(sstart);

Upvotes: 0

Views: 63

Answers (1)

CodeFuller
CodeFuller

Reputation: 31282

Syntax of you regular expressions is incorrect because of '++' part.

.+ matches one or more occurrences. But what do you try to match with .++ ?

Upvotes: 1

Related Questions