mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
expr: Fix regex anchor matching behavior with REGEX_OPTION_SINGLELINE
The previously used `REGEX_OPTION_NONE` allowed anchors (^) and ($) to match across newlines. New anchor behaviors: - `^` matches the start of the entire string (`\A`) - `$` matches the end of the entire string (`\Z`)
This commit is contained in:
parent
606c0c1f57
commit
8cd51227c6
1 changed files with 1 additions and 1 deletions
|
@ -154,7 +154,7 @@ impl StringOp {
|
|||
let re_string = format!("{prefix}{right}");
|
||||
let re = Regex::with_options(
|
||||
&re_string,
|
||||
RegexOptions::REGEX_OPTION_NONE,
|
||||
RegexOptions::REGEX_OPTION_SINGLELINE,
|
||||
Syntax::grep(),
|
||||
)
|
||||
.map_err(|_| ExprError::InvalidRegexExpression)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue