validate_delimiter

Function validate_delimiter 

Source
pub fn validate_delimiter(delimiter: &[u8]) -> bool
Expand description

function validate_delimiter checks delimiter against DELIMITER_CHARS, A byte sequence that consists of either a single-byte candidate puncutation or multiple (up to 4) repetitive ones is valid for enclosing pattern text. Note bracket style delimiters in many PCRE (Perl Compatible Regular Expressions 1) engines are excluded from DELIMITER_CHARS, as they are reserved for delimiting elements in regex sets.

Note:

  • There are two styles of delimiters in PCRE: matched delimiters and bracket-style delimiters. This Rust crate regex-literal only uses matched delimiters: single or mutiple repeated punctuation characters (excluding quote characters: “ ’ `) in enclosing regex literals. Bracket-style punctuations ([],<>,(),{}, and etc) are reserved for regex set literals.