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 11, 2020
1 parent 81d751f commit 221c117
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

1 comment on commit 221c117

@lovasoa
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.