Analyze if the second term is a subset of the first.
curl -X POST "https://api.regexsolver.com/api/analyze/subset" \
-H "Authorization: Bearer $REGEX_SOLVER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"terms":[{"type":"regex","value":"de"},{"type":"regex","value":"(abc|de)"}]}'
{
"type": "boolean",
"value": true
}
Term.Regex term1 = Term.regex("de");
Term.Regex term2 = Term.regex("(abc|de)");
boolean result = term1.isSubsetOf(term2);
System.out.println(result);
true
const term1 = Term.regex("de");
const term2 = Term.regex("(abc|de)");
term1.isSubsetOf(term2).then(result => {
console.log(result);
});
true
term1 = Term.regex(r"de")
term2 = Term.regex(r"(abc|de)")
result = term1.is_subset_of(term2)
print(result)
True