Humam Helfawi
Humam Helfawi

Reputation: 20264

Is the R before string cross-platform

From MSDN, this code is used in order to match regular expression:

if (regex_match(s, m, regex { R"((\w+) (\w+))" }))
{
}

Is using the R before the string quota a standard C++?

Upvotes: 0

Views: 277

Answers (2)

Dimitrios Bouzas
Dimitrios Bouzas

Reputation: 42899

Yes it's standard C++. So as such is cross-platform. According to cppreference:

prefix(optional) R "delimiter( raw_character* )delimiter" 

Represents raw string literal. Used to avoid escaping of any character, anything between the delimiters becomes part of the string, if prefix is present has the same meaning as described above.

Upvotes: 3

ildjarn
ildjarn

Reputation: 62975

Yes; this notation is known as a "raw string literal", and was standardized in C++11. Further (non-MSDN) documentation can be found here.

Upvotes: 3

Related Questions