[][src]Function voca_rs::escape::escape_regexp

pub fn escape_regexp(subject: &str) -> String

Escapes the regular expression special characters - [ ] / { } ( ) * + ? . \ ^ $ | in subject.

Arguments

Example

use voca_rs::*;
escape::escape_regexp("(hours)[minutes]{seconds}");
// => \(hours\)\[minutes\]\{seconds\}
use voca_rs::Voca;
"(hours)[minutes]{seconds}"._escape_regexp();
// => \(hours\)\[minutes\]\{seconds\}