Skip to content

Commit

Permalink
doc: clarify docs for is_match
Browse files Browse the repository at this point in the history
This makes it a bit clearer that `is_match` does not require the match
to span the entire string, but rather, that a match may occur anywhere
in the string.

Closes #711
  • Loading branch information
lovasoa authored and BurntSushi committed Oct 12, 2020
1 parent 18cb604 commit 0e21edc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/re_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ impl Regex {
RegexBuilder::new(re).build()
}

/// Returns true if and only if the regex matches the string given.
/// Returns true if and only if there is a match for the regex in the
/// string given.
///
/// It is recommended to use this method if all you need to do is test
/// a match, since the underlying matching engine may be able to do less
Expand Down
3 changes: 2 additions & 1 deletion src/re_unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ impl Regex {
RegexBuilder::new(re).build()
}

/// Returns true if and only if the regex matches the string given.
/// Returns true if and only if there is a match for the regex in the
/// string given.
///
/// It is recommended to use this method if all you need to do is test
/// a match, since the underlying matching engine may be able to do less
Expand Down

0 comments on commit 0e21edc

Please sign in to comment.