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

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

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

Arguments

  • subject - The string to escape.

Example

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