Yes, it is certainly possible to decide this property. Put another way, given two regular expressions, you want to know whether their intersection is empty.

From a theoretical point of view, it is no problem to compute the intersection of two regular expressions. From a practical point of view, it is a bit of a pain, since you must convert to DFAs somewhere along the way. NFAs and regular expressions aren't immediately amenable to the intersection operation. Keep in mind that these kinds of problems (intersecting and/or complementing languages represented as regular expressions) are usually PSPACE-hard, which is even worse than NP-hard.

If you don't want to code up algorithms for regular expression → DFA conversion and DFA intersection, you might want to check out this suite that does these kinds of manipulations of regular expressions. The authors (myself and another monk) have not worked on it for quite some time, but I think that this simple kind of functionality is in the code. I believe that something like this would work:

use FLAT; my $r1 = FLAT::Regex->new( $expr1 ); my $r2 = FLAT::Regex->new( $expr2 ); print $r1->intersect($r2)->is_empty ? "disjoint" : "overlapping";
Extending this to a large number of regular expressions means that you must just check the intersection of all pairs of regexes.

Update: some related reading: Comparative satisfiability of regexps.; Testing regex equivalence; Negating Regexes: Tips, Tools, And Tricks Of The Trade.

blokhead


In reply to Re: mutual exclusion of regexes by blokhead
in thread mutual exclusion of regexes by morgon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.