nfa_regex

Crates.ionfa_regex
lib.rsnfa_regex
version1.0.1
sourcesrc
created_at2021-06-14 11:39:09.260857
updated_at2021-06-14 11:55:07.330388
descriptionSimple NFA regex engine for text processing.
homepage
repositoryhttps://github.com/ashgamer10/rust_nfa_regex.git
max_upload_size
id409895
size88,599
Ashutosh Tiwari (ashgamer10)

documentation

README

nfa_regex

Simple non finite automata regular expression (NFA regex) engine.

Usage

Add this to your Cargo.toml:

[dependencies]
nfa_regex = "1.0.0"

Add this to your crate root:

extern crate nfa_regex;

E.g. Create regex variable to match numeric type:

let mut r = nfa_regex::Regex::new("[\\+\\-]?[0-9]+(\\.[0-9]+)?([eE][\\+\\-]?[0-9]+)?").unwrap();
assert_eq!(r.match_pattern("-2.6e-6"), true);
assert_eq!(r.search_pattern_and_get_slice("pi = 3.141593, etc."), ("pi = ", "3.141593", ", etc."));

Features

Supported regex operators:

Repeatition: +, *, ?, {m,n}
Or:          |
Not:         ^ (only used inside '[]')
Escape:      \
Bracket:     []
Grouping:    ()

Functions:

  • Match pattern to input string.
  • Search pattern into input string.
  • Replace pattern found into input string.

Releases

See RELEASES.md

Compatibility

The nfa_regex crate is created and tested with rustc 1.51.0 and greater.

License

Licensed under

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed under Apache-2.0, without any additional terms or conditions.

Commit count: 5

cargo fmt