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
Guides
Advanced Usage
API Reference
Docs

Sync and Async Clients

The official RegexSolver libraries send their requests through a client. Java and Python each ship a synchronous client and an asynchronous one; JavaScript ships a single client, and it is asynchronous. This page shows how to use each of them.

In Java, you can choose between RegexSolverClient (synchronous) and AsyncRegexSolverClient (asynchronous).

Synchronous

Code
import com.regexsolver.api.RegexSolverClient; import com.regexsolver.api.Term; import com.regexsolver.api.exceptions.ApiException; public class Main { public static void main(String[] args) throws ApiException { RegexSolverClient client = RegexSolverClient.builder() .apiToken(System.getenv("REGEXSOLVER_API_TOKEN")) .build(); Term a = Term.regex("abc"); Term b = Term.regex("def"); Term result = client.union(a, b); System.out.println(result); } }

Asynchronous

Code
import com.regexsolver.api.AsyncRegexSolverClient; import com.regexsolver.api.Term; import com.regexsolver.api.exceptions.ApiException; import java.util.concurrent.CompletableFuture; public class Main { public static void main(String[] args) throws ApiException { AsyncRegexSolverClient client = AsyncRegexSolverClient.builder() .apiToken(System.getenv("REGEXSOLVER_API_TOKEN")) .build(); Term a = Term.regex("abc"); Term b = Term.regex("def"); // Returns a CompletableFuture<Term> client.union(a, b) .thenAccept(result -> System.out.println("Union: " + result)); } }
Last modified on August 8, 2026
All OperationsPlans and Pricing
Java
Java