Demo
Runs in your browser, on regexsolver compiled to WebAssembly: nothing is sent anywhere. A result can be shown as its automaton, or as a pattern by state elimination or by a neural synthesis model, downloaded from Hugging Face on first use. The address bar keeps the inputs, so a demo can be shared by its link.
› THE SAME CALL IN RUST
use regexsolver::Term;
use regexsolver::neural_synthesis::{Device, NeuralSynthesizer};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let a: Term = "/api/v[12]/.*".parse()?;
let b: Term = ".*/users/[0-9]+".parse()?;
let result = a.intersection([&b])?;
let synthesizer = NeuralSynthesizer::from_hub(
"alexvbrdn/kleene2-5m-b16-t128",
Device::best_available(),
)?;
println!("{}", result.to_pattern_with(&synthesizer)?);
Ok(())
}