mirror of
https://github.com/chmln/sd
synced 2024-10-03 06:03:32 +00:00
Add s
flag to make .
match newline
This commit is contained in:
parent
860824b88d
commit
1a622ce1fd
|
@ -29,6 +29,7 @@ pub(crate) struct Options {
|
||||||
c - case-sensitive
|
c - case-sensitive
|
||||||
i - case-insensitive
|
i - case-insensitive
|
||||||
m - multi-line matching
|
m - multi-line matching
|
||||||
|
s - make `.` match newlines
|
||||||
w - match full words only
|
w - match full words only
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,6 +54,9 @@ impl Replacer {
|
||||||
'm' => {
|
'm' => {
|
||||||
regex.multi_line(true);
|
regex.multi_line(true);
|
||||||
}
|
}
|
||||||
|
's' => {
|
||||||
|
regex.dot_matches_new_line(true);
|
||||||
|
}
|
||||||
'w' => {
|
'w' => {
|
||||||
regex = regex::bytes::RegexBuilder::new(&format!(
|
regex = regex::bytes::RegexBuilder::new(&format!(
|
||||||
"\\b{}\\b",
|
"\\b{}\\b",
|
||||||
|
|
Loading…
Reference in a new issue