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
    DeterminismString Generation OrderingBounding ExecutionHeavy OperationsAuto-Batching
API Reference
Advanced Usage

Auto-Batching

Your plan caps how many Terms a single request may carry: the Max Terms per Operation limit, 5 on the Free plan (see Plans and Pricing). Auto-batching lets you call union, intersection and concat with more Terms than that and still get a single result back.

It is enabled by default and requires no configuration.

How it works

The first time a client needs them, it fetches your account limits from the API and caches them for its lifetime. When a call carries more Terms than maxTermsCount, the client:

  1. Splits the Term list into chunks that fit within the cap.
  2. Sends one request per chunk.
  3. Feeds the results back into further requests until a single Term remains.

This works because union, intersection and concat are associative: combining the results of the chunks gives the same language as combining every Term at once. Operations that take a fixed number of Terms, such as difference, equivalent and subset, are never batched.

Code
RegexSolverClient client = RegexSolverClient.builder() .apiToken(System.getenv("REGEXSOLVER_API_TOKEN")) .build(); // 12 terms on a plan that allows 5 per request List<Term> terms = new ArrayList<>(); for (String pattern : patterns) { terms.add(Term.regex(pattern)); } // A single call; the client issues several requests Term result = client.union(terms);

What it costs

Each request the client sends counts against your monthly quota and your rate limit, and the chunks are separate round trips. A union of 12 Terms on the Free plan therefore consumes several requests and takes correspondingly longer.

Disabling it

Turn auto-batching off at client construction if you would rather oversized calls failed explicitly, so that you control how they are split. Calls above the cap then raise TooManyTerms (see Error Handling).

Code
RegexSolverClient client = RegexSolverClient.builder() .apiToken(System.getenv("REGEXSOLVER_API_TOKEN")) .autoBatch(false) .build(); try { Term result = client.union(manyTerms); // more terms than the plan allows } catch (TooManyTermsException e) { System.out.println("Split the call yourself: " + e.getMessage()); }

Auto-batching splits by Term count only. It does not split work that is heavy because a single Term is complex. For that, see Bounding Execution and Heavy Operations.

Last modified on August 8, 2026
Heavy Operations
On this page
  • How it works
  • What it costs
  • Disabling it
Java
Java