Given two regular expressions, is it possible to detect whether there is any possible string that matches them both?
For example, given regexes A
and .
, I can see that string "A"
matches them both. That's a simple case.
My question is for the broader case -- given any two valid regexes, would it be possible to definitively say whether there is any possible string that would match both regexes? Assume that there is no sample set of input strings to test. All I have are the regexes. I don't necessarily need to produce matching strings -- I just need to determine that there are possible strings that match both.
Will accept discussions for any of the common regex specifications -- .NET, Java, PERL, sed, grep, etc.