Crates.io | regexsolver |
lib.rs | regexsolver |
version | |
source | src |
created_at | 2024-10-06 14:08:55.486419 |
updated_at | 2024-12-28 17:15:17.312276 |
description | Manipulate regex and automaton as if they were sets. |
homepage | |
repository | https://github.com/RegexSolver/regexsolver |
max_upload_size | |
id | 1399112 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This repository contains the code of RegexSolver engine.
For more information, you can check the library's documentation.
If you want to use this library with other programming languages, we provide a wide range of wrappers:
For more information about how to use the wrappers, you can refer to our getting started guide.
Add the following line in your Cargo.toml
:
[dependencies]
regexsolver = "0.3"
use regexsolver::Term;
let term1 = Term::from_regex("abc").unwrap();
let term2 = Term::from_regex("de").unwrap();
let term3 = Term::from_regex("fghi").unwrap();
let union = term1.union(&[term2, term3]).unwrap();
if let Term::RegularExpression(regex) = union {
println!("{}", regex.to_string()); // (abc|de|fghi)
}
use regexsolver::Term;
let term1 = Term::from_regex("(abc|de){2}").unwrap();
let term2 = Term::from_regex("de.*").unwrap();
let term3 = Term::from_regex(".*abc").unwrap();
let intersection = term1.intersection(&[term2, term3]).unwrap();
if let Term::RegularExpression(regex) = intersection {
println!("{}", regex.to_string()); // deabc
}
use regexsolver::Term;
let term1 = Term::from_regex("(abc|de)").unwrap();
let term2 = Term::from_regex("de").unwrap();
let subtraction = term1.subtraction(&term2).unwrap();
if let Term::RegularExpression(regex) = subtraction {
println!("{}", regex.to_string()); // abc
}