Allow to set dotall and multiline flag also for normal regex patterns

This commit is contained in:
Rot127 2026-06-28 15:05:16 +02:00 committed by Rot127
parent 90b7a928db
commit e6362c2942

View file

@ -1458,6 +1458,14 @@ RZ_API RzRegexFlags rz_regex_parse_flag_desc(RZ_NULLABLE const char *re_flags_de
flags |= RZ_REGEX_LITERAL;
goto return_flags;
}
if (strchr(re_flags_desc, 'd')) {
fcount++;
flags |= RZ_REGEX_DOTALL;
}
if (strchr(re_flags_desc, 'm')) {
fcount++;
flags |= RZ_REGEX_MULTILINE;
}
if (strchr(re_flags_desc, 'r')) {
fcount++;
goto return_flags;
@ -1470,14 +1478,6 @@ RZ_API RzRegexFlags rz_regex_parse_flag_desc(RZ_NULLABLE const char *re_flags_de
fcount++;
flags |= RZ_REGEX_EXTENDED_MORE;
}
if (strchr(re_flags_desc, 'm')) {
fcount++;
flags |= RZ_REGEX_MULTILINE;
}
if (strchr(re_flags_desc, 'd')) {
fcount++;
flags |= RZ_REGEX_DOTALL;
}
return_flags:
if (fcount != strlen(re_flags_desc)) {
RZ_LOG_ERROR("Flag combination '%s' is invalid.\n", re_flags_desc);