mirror of
https://github.com/chmln/sd
synced 2025-02-16 15:58:23 +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
|
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…
Add table
Reference in a new issue