Skip to content

Commit

Permalink
Fix PO parser's multiline regex to work under GCC and Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Jun 24, 2024
1 parent d40dce6 commit e0de109
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/po_file_review.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ namespace i18n_check
static const std::wstring_view MSGSTR0{ L"msgstr[0] \"" };
static const std::wstring_view MSGSTR1{ L"msgstr[1] \"" };
// type of printf formatting the string uses
static const std::wregex entryLineRegEx{ LR"(^#, ([,a-z \-]+)+$)" };
static const std::wregex entryLineRegEx{ LR"(^#, ([,a-z \-]+)+$)",
// MSVC doesn't have the std::regex::multiline, but behaves multiline implicitly.
// GCC and Clang require this flag though.
#ifdef _MSC_VER
std::regex::ECMAScript };
#else
std::regex::ECMAScript | std::regex::multiline };
#endif

// captures the "no-" prefix (in case it's in there) so that we know
// to ignore this entry later
static const std::wregex printfResourceRegEx{ LR"(\b([a-zA-Z\-])+\b)" };
Expand Down

0 comments on commit e0de109

Please sign in to comment.