Merge pull request #51 from crides/master

Add `s` flag to make `.` match newline
This commit is contained in:
Gregory 2019-07-25 00:19:42 -04:00 committed by GitHub
commit ac5040537e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -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
*/

View file

@ -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",