Skip to content

regex 1.0 #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove Regex::with_size_limit.
This is replaced by using RegexBuilder.

Fixes #166
  • Loading branch information
BurntSushi committed Aug 5, 2016
commit 16bb79a2e74fdee9f6cdacf4312987867f4e135c
11 changes: 1 addition & 10 deletions src/re_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,7 @@ impl Regex {
///
/// If an invalid expression is given, then an error is returned.
pub fn new(re: &str) -> Result<Regex, Error> {
Regex::with_size_limit(10 * (1 << 20), re)
}

/// Compiles a regular expression with the given size limit.
///
/// The size limit is applied to the size of the *compiled* data structure.
/// If the data structure exceeds the size given, then an error is
/// returned.
pub fn with_size_limit(size: usize, re: &str) -> Result<Regex, Error> {
RegexBuilder::new(re).size_limit(size).compile()
RegexBuilder::new(re).compile()
}

/// Returns true if and only if the regex matches the string given.
Expand Down
11 changes: 1 addition & 10 deletions src/re_unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,7 @@ impl Regex {
///
/// If an invalid expression is given, then an error is returned.
pub fn new(re: &str) -> Result<Regex, Error> {
Regex::with_size_limit(10 * (1 << 20), re)
}

/// Compiles a regular expression with the given size limit.
///
/// The size limit is applied to the size of the *compiled* data structure.
/// If the data structure exceeds the size given, then an error is
/// returned.
pub fn with_size_limit(size: usize, re: &str) -> Result<Regex, Error> {
RegexBuilder::new(re).size_limit(size).compile()
RegexBuilder::new(re).compile()
}

/// Returns true if and only if the regex matches the string given.
Expand Down