simple-text-pattern

Crates.iosimple-text-pattern
lib.rssimple-text-pattern
version0.1.0
sourcesrc
created_at2019-04-16 21:58:18.523697
updated_at2019-04-16 21:58:18.523697
descriptionMatching simple text patterns.
homepage
repositoryhttps://github.com/svmk/simple-text-pattern
max_upload_size
id128460
size11,243
(svmk)

documentation

README

Travis Build Status MIT licensed crates.io Released API docs

Rust simple text pattern library

This crate provides a library for compiling and matching simple text patterns.

Example

Passed pattern some*text will be compiled into equivalent regexp ^some.*text$.

Syntax

  • * - one or more any symbol.
  • any other text - interpreted as simple text.

Usage

use simple_text_pattern::Pattern;
let pattern = Pattern::new("some*text").expect("Unable to compile pattern");
assert_eq!(true, pattern.is_match("sometext"));
assert_eq!(true, pattern.is_match("some text"));
assert_eq!(false, pattern.is_match("not some text"));
Commit count: 2

cargo fmt