I guess my question is best explained with an (simplified) example.
Given the case there's one regex like
^\d+_[a-z]+$
and another regex like
^\d*$
it's clear that something regex 1 matches to, will never match regex 2. So regex 2 is orthogonal to regex 1.
As many people asked what I meant by orthogonal I'll try to clarify it:
Let S1 be the (infinite) set of strings where regex 1 matches. S2 is the set of strings where regex 2 matches. Regex 2 is orthogonal to regex 1 iff the intersection of S1 and S2 is empty. The regex ^\d_a$ would be not orthonal as the String '2_a' is in the set S1 and S2.
In some cases it is certainly not possible to determine if a regex is orthogonal to another regex.
My question is, how can it be programmatically determined, if a regex is orthognal to another?
Best case would be some library that implements a method like:
/**
* @return True if the regex is orthogonal (i.e. "intersection is empty"), False otherwise or Null if it can't be determined
*/
public Boolean isRegexOrthogonal(Pattern regex1, Pattern regex2);