RegexSolverRegexSolver
  • Live Demo
  • Docs
  • Pricing
  • Open Source ↗
  • Console ↗
Console ↗
  • Docs
  • API Reference
HELP
  • Documentation
  • Report an issue ↗
RESOURCES
  • Developer console
  • GitHub ↗
LEGAL
  • Privacy policy
  • Terms & conditions
RegexSolverRegexSolver

© 2026 REGEXSOLVER · ALL RIGHTS RESERVED

QuickstartAll OperationsSync and Async ClientsPlans and Pricing
Core Concepts
    Term's FormatUnion, Intersection, Difference and ComplementConcatenation and RepetitionEquivalence and SubsetAnalyzing a TermGenerate Strings
Guides
Advanced Usage
API Reference
Core Concepts

Equivalence and Subset

These operations compare two Terms by language and return a boolean.

Equivalent

Two Terms are equivalent when they match exactly the same set of strings, even if written differently.

Example:

Code
RegexSolverClient client = RegexSolverClient.builder() .apiToken(System.getenv("REGEXSOLVER_API_TOKEN")) .build(); Term a = Term.regex("a(b|c)"); Term b = Term.regex("ab|ac"); boolean result = client.equivalent(a, b); System.out.println(result); // true

Subset

A Term A is a subset of B if every string matched by A is also matched by B.

Example:

Code
RegexSolverClient client = RegexSolverClient.builder() .apiToken(System.getenv("REGEXSOLVER_API_TOKEN")) .build(); Term a = Term.regex("cat|dog"); Term b = Term.regex("[a-z]+"); boolean r1 = client.subset(a, b); System.out.println(r1); // true boolean r2 = client.subset(b, a); System.out.println(r2); // false
Last modified on August 8, 2026
Concatenation and RepetitionAnalyzing a Term
On this page
  • Equivalent
  • Subset
Java
Java