From: Thibaut Cuvelier Date: Thu, 9 Jul 2020 00:38:07 +0000 (+0200) Subject: Fix use of std::regex_match X-Git-Tag: lyx-2.4.0dev-acb2ca7b~584 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=467d57bc;p=lyx.git Fix use of std::regex_match --- diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 3e59d654ce..2f41c0ec5f 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1191,20 +1191,19 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const while (tagIt != tagEnd) { string tag = tagIt->str(); // regex_match cannot work with temporary strings. ++tagIt; - std::regex_match(tag, match, tagRegex); + regex_match(tag, match, tagRegex); - if (toDocBookTag.find(match[1]) == toDocBookTag.end()) { + if (regex_match(tag, match, tagRegex)) { + if (toDocBookTag[match[1]] == "SPECIFIC") { + delayedTags[match[1]] = match[2]; + } else { + xs << xml::StartTag(toDocBookTag[match[1]]); + xs << from_utf8(match[2].str()); + xs << xml::EndTag(toDocBookTag[match[1]]); + } + } else { LYXERR0("The BibTeX field " << match[1].str() << " is unknown."); xs << XMLStream::ESCAPE_NONE << from_utf8("\n"); - continue; - } - - if (toDocBookTag[match[1]] == "SPECIFIC") { - delayedTags[match[1]] = match[2]; - } else { - xs << xml::StartTag(toDocBookTag[match[1]]); - xs << from_utf8(match[2].str()); - xs << xml::EndTag(toDocBookTag[match[1]]); } }