[Regex] \r matching \n
Olaf van der Spek via Boost <[email protected]>
| Newsgroups | gmane.comp.lib.boost.devel |
|---|---|
| Message-ID | <CAGVGHmuBTFhfDBxxbGU-Z-7+sg5sWKCREMbDYhn-n+5JN=oHcw@mail.gmail.com> |
Hi,
In this regex the \n matches \r. How is this defined / controlled? Is
there a way to only match \n?
std::string s = "[*] A\rB\n";
s = boost::regex_replace(s, boost::regex(R"(\[\*\](.+?)(\n|$))"),
"<li>\\1</li>");
std::println("{}", js_encode(s)); // <li> A</li>\rB\n
Regards,
--
Olaf
_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/ZLTNOPBBWGK5CCADZNZMT4J6BNADRLGJ/