Crates.io | nfa_regex |
lib.rs | nfa_regex |
version | 1.0.1 |
source | src |
created_at | 2021-06-14 11:39:09.260857 |
updated_at | 2021-06-14 11:55:07.330388 |
description | Simple NFA regex engine for text processing. |
homepage | |
repository | https://github.com/ashgamer10/rust_nfa_regex.git |
max_upload_size | |
id | 409895 |
size | 88,599 |
Simple non finite automata regular expression (NFA regex) engine.
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."));
Supported regex operators:
Repeatition: +, *, ?, {m,n}
Or: |
Not: ^ (only used inside '[]')
Escape: \
Bracket: []
Grouping: ()
Functions:
See RELEASES.md
The nfa_regex
crate is created and tested with rustc 1.51.0 and greater.
Licensed under
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.