|XP is just a number|
mutual exclusion of regexesby morgon (Priest)
|on Apr 13, 2009 at 22:34 UTC||Need Help??|
morgon has asked for the wisdom of the Perl Monks concerning the following question:
assume I have a list of "simple enough" regexes (in the sense that they don't contain any backrefs, embedded code or the like).
Is it possible to decide (and if so what would be a good algorithm for that) that every possible string matches only against at most one regex in the list - or put another way that no possible string would match against 2 or more regexes of the list.
So I want an algorithm that takes a list of regexes and decides whether these regexes are mutual exclusive in the sense that no string would ever match against more than 1 regex of the list.