Crate like

Source
Expand description

A SQL like style pattern matching.

§Usage

To do a patten matching, use Like:

use like::Like;

assert!(Like::<false>::like("Hello, world!", "Hello%").unwrap());

To do a case-insensitive pattern matching, use ILike:

use like::ILike;

assert!(ILike::<false>::ilike("Hello, world!", "HELLO%").unwrap());

To convert the pattern to use standard backslash escape convention, use Escape:

use like::Escape;

assert_eq!("Hello$%".escape("$").unwrap(), "Hello\\%");

Structs§

InvalidPatternError
Errors which can occur when attempting to match a pattern.

Enums§

InvalidEscapeError
Errors which can occur when attempting to convert escape.

Traits§

Escape
Convert the pattern to use standard backslash escape convention.
ILike
SQL ilike style pattern matching.
Like
SQL like style pattern matching.