From 1a622ce1fd40ef565c84ff815ba251ba66e1628f Mon Sep 17 00:00:00 2001 From: crides Date: Wed, 24 Jul 2019 09:41:22 +0800 Subject: [PATCH] Add `s` flag to make `.` match newline --- src/app.rs | 1 + src/input.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/app.rs b/src/app.rs index 6841c21..523aece 100644 --- a/src/app.rs +++ b/src/app.rs @@ -29,6 +29,7 @@ pub(crate) struct Options { c - case-sensitive i - case-insensitive m - multi-line matching + s - make `.` match newlines w - match full words only */ diff --git a/src/input.rs b/src/input.rs index c6e012a..c27bc1d 100644 --- a/src/input.rs +++ b/src/input.rs @@ -54,6 +54,9 @@ impl Replacer { 'm' => { regex.multi_line(true); } + 's' => { + regex.dot_matches_new_line(true); + } 'w' => { regex = regex::bytes::RegexBuilder::new(&format!( "\\b{}\\b",