Convert both to DFA's, create the intersection DFA, check for empty
(check final state accessability). all those steps can be found in any
automata theory textbook. Unfortunately, this appears to be an
expotential time algorithm because of the first step.
--
Mark Biggar
mark.a...@attbi.com
If you don't actually need to calculate the intersection, then you can test
to see if it's non-empty in polynomial time. Just convert each regular
expression into an NFA, and calculate the set of valid NFA state pairs
(A,B), A in regex 1, B in regex 2, reachable by the same string. To
calculate this set, start with the pair of start states and generate the
obvious closure. Iff the pair of terminal states is included in the final
result, then the expressions intersect.