
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
regexsolver
Advanced tools
RegexSolver allows you to manipulate regular expressions as sets, enabling operations such as intersection, union, and subtraction.
Homepage | Documentation | Developer Console
This repository contains the source code of the Python library for RegexSolver API.
RegexSolver is a powerful regular expression manipulation toolkit, that gives you the power to manipulate regex as if they were sets.
pip install --upgrade regexsolver
In order to use the library you need to generate an API Token on our Developer Console.
from regexsolver import RegexSolver, Term
RegexSolver.initialize("YOUR TOKEN HERE")
term1 = Term.regex(r"(abc|de|fg){2,}")
term2 = Term.regex(r"de.*")
term3 = Term.regex(r".*abc")
term4 = Term.regex(r".+(abc|de).+")
result = term1.intersection(term2, term3)\
.subtraction(term4)
print(result)
Compute the intersection of the provided terms and return the resulting term.
The maximum number of terms is currently limited to 10.
term1 = Term.regex(r"(abc|de){2}")
term2 = Term.regex(r"de.*")
term3 = Term.regex(r".*abc")
result = term1.intersection(term2, term3)
print(result)
regex=deabc
Compute the union of the provided terms and return the resulting term.
The maximum number of terms is currently limited to 10.
term1 = Term.regex(r"abc")
term2 = Term.regex(r"de")
term3 = Term.regex(r"fghi")
result = term1.union(term2, term3)
print(result)
regex=(abc|de|fghi)
Compute the first term minus the second and return the resulting term.
term1 = Term.regex(r"(abc|de)")
term2 = Term.regex(r"de")
result = term1.subtraction(term2)
print(result)
regex=abc
Analyze if the two provided terms are equivalent.
term1 = Term.regex(r"(abc|de)")
term2 = Term.regex(r"(abc|de)*")
result = term1.is_equivalent_to(term2)
print(result)
False
Analyze if the second term is a subset of the first.
term1 = Term.regex(r"de")
term2 = Term.regex(r"(abc|de)")
result = term1.is_subset_of(term2)
print(result)
True
Compute the details of the provided term.
The computed details are:
term = Term.regex(r"(abc|de)")
details = term.get_details()
print(details)
Details[cardinality=Integer(2), length=Length[minimum=2, maximum=3], empty=false, total=false]
Generate the given number of strings that can be matched by the provided term.
The maximum number of strings to generate is currently limited to 200.
term = Term.regex(r"(abc|de){2}")
strings = term.generate_strings(3)
print(strings)
['deabc', 'abcde', 'dede']
FAQs
RegexSolver allows you to manipulate regular expressions as sets, enabling operations such as intersection, union, and subtraction.
We found that regexsolver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.