Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion regex-syntax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ fn binary_search<T, F>(xs: &[T], mut pred: F) -> usize
///
/// The string returned may be safely used as a literal in a regular
/// expression.
pub fn quote(text: &str) -> String {
pub fn escape(text: &str) -> String {
let mut quoted = String::with_capacity(text.len());
for c in text.chars() {
if parser::is_punct(c) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ pub use re_unicode::{
Regex, Captures, SubCaptures, SubCapturesPos, SubCapturesNamed,
CaptureNames, FindCaptures, FindMatches,
Replacer, NoExpand, RegexSplits, RegexSplitsN,
quote, is_match,
escape, is_match,
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/re_unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use re_trait::{self, RegularExpression, Slot};
///
/// The string returned may be safely used as a literal in a regular
/// expression.
pub fn quote(text: &str) -> String {
syntax::quote(text)
pub fn escape(text: &str) -> String {
syntax::escape(text)
}

/// Tests if the given regular expression matches somewhere in the text given.
Expand Down