Hello Locutus,
I assume your sample data are (over-)simplified for the purposes of illustration? The problem is, I find it hard to extrapolate from the example given to a more realistic scenario. Let S = { treasure, tree, train }. Do you want to construct the partition S = { treasure, tree } ∪ { train } by distinguishing words beginning with tre from others? Or should S be a single partition of words beginning tr? I think a more complex example would go a long way towards clarifying what you are trying to accomplish.
A preliminary search of the CPAN threw up the String::REPartition module. While this isn’t what you’re looking for, it might give you some useful ideas.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Partitioning a set of strings by regular expressions
by Athanasius
in thread Partitioning a set of strings by regular expressions
by Locutus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |