Crates.io | like |
lib.rs | like |
version | 0.3.1 |
source | src |
created_at | 2020-08-16 08:59:15.965444 |
updated_at | 2022-03-16 01:12:06.209687 |
description | A SQL like style pattern matching. |
homepage | https://github.com/cod-technologies/like |
repository | https://github.com/cod-technologies/like.git |
max_upload_size | |
id | 277169 |
size | 47,414 |
A SQL like
style pattern matching.
To do a patten matching, use Like
:
use like::Like;
// Has Escape
assert!(Like::<true>::like("Hello, world!", "Hello%").unwrap());
// No Escape
assert!(Like::<false>::like("Hello, world!", "Hello%").unwrap());
To do a case-insensitive pattern matching, use ILike
:
use like::ILike;
// Has Escape
assert!(ILike::<true>::ilike("Hello, world!", "HELLO%").unwrap());
// No Escape
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\\%");
This version of like
requires Rust 1.57 or later.
This project is licensed under the Apache-2.0 license (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in like
by you, shall be licensed as Apache-2.0, without any additional
terms or conditions.