A test suite samples a few strings; the automaton checks them all. Prove two patterns equivalent, prove a rewrite only tightens, count and bound every possible match. Exact answers, one call.
Each card calls the real API. Edit the patterns and compute. No signup.
| Operation | Notation | Answers | Returns |
|---|---|---|---|
| cardinality | |A| | How many distinct strings does the pattern match? | count | ∞ |
| length | len(A) | Shortest and longest possible match. | [min, max] |
| empty / total | A = ∅ · A = Σ* | Matches nothing at all? Matches everything? | boolean |
| equivalent | A ≡ B | Same language, regardless of syntax? | boolean |
| subset | A ⊆ B | Is every match of A also a match of B? | boolean |
| pattern | re(A) | A compact, human-readable regex for any term. | regex |
| empty_string | A = {ε} | Matches only the empty string? | boolean |
| deterministic | det(A) | Is the automaton deterministic? A stable string order requires it. | boolean |
| dot | dot(A) | The automaton as a Graphviz DOT graph, ready to render. | dot |
Every operation above through the official client. The API is plain REST underneath, so any HTTP client works too.
import { RegexSolverClient, Term } from 'regexsolver';
const client = new RegexSolverClient({ apiToken: 'REGEXSOLVER_API_TOKEN' });
// Same rule, written two ways?
await client.equivalent(Term.regex("(abcd|abef)"), Term.regex("ab(cd|ef)"));
// true
// Did the refactor make the validator stricter? New matches must all be old matches.
await client.subset(Term.regex("beta-[0-9]{4}"), Term.regex("(alpha|beta)-[0-9]{4}"));
// true
// Exact size of the language, not a sample
await client.getCardinality(Term.regex("[a-f0-9]{5}"));
// 1048576
// Shortest and longest possible match
await client.getLength(Term.regex("(alpha|beta|prod)-[a-z0-9]{4}"));
// [9, 10]
// Prove two rules identical: their difference must be empty
const gap = await client.difference(Term.regex("(abcd|abef)"), Term.regex("ab(cd|ef)"));
await client.isEmpty(gap);
// true