mirror of
https://github.com/chmln/sd
synced 2024-11-22 11:13:04 +00:00
Merge pull request #51 from crides/master
Add `s` flag to make `.` match newline
This commit is contained in:
commit
ac5040537e
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
||||
*/
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue