in reply to Partitioning a set of strings by regular expressions

Sounds like you want Arden's Theory, which allows you to convert a deterministic finite automata into a regular expression.

https://cs.stackexchange.com/questions/93712/understanding-application-of-ardens-theorem-to-find-regular-expression

Also, this might point you in the right direction with JFLAP (not Perl),

http://www.jflap.org/modules/ConvertedFiles/DFA%20to%20Regular%20Expression%20Conversion%20Module.pdf

While not necessarily Perl regular expressions, Perl does support the classical regular expression operators as defined in formal language theory.

  • Comment on Re: Partitioning a set of strings by regular expressions