摘要 |
A method, apparatus and computer program product are provided for testing software programs which use regular expressions. In one regard, a method for determining whether two or more regular expressions are disjoint is provided that includes receiving two or more regular expressions, determining whether at least one common regular expression exists between the two or more regular expressions, and in an instance in which one does not exist, causing an indication of disjointedness to be provided. A corresponding method for determining a common regular expression of two or more regular expressions is also provided that includes causing respective deterministic finite automaton (DFA) representations to be created for two or more regular expressions, causing a DFA representation of a candidate common regular expression to be created based on the DFA representations of the regular expressions and determining if the DFA representation of the candidate common regular expression includes a terminal state. |