simple-text-pattern 0.1.0

Matching simple text patterns.
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented1 out of 4 items with examples
  • Size
  • Source code size: 10.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.67 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • svmk/simple-text-pattern
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • svmk

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"));