From: Rich Morin Date: 2005-12-22T08:42:40+09:00 Subject: Re: Regex: Up for a challenge? My first cut at the problem would be to * write a generator that translates string sequences i pa(ki) pag into persistent lists of prefixes i, pa, pag, ipa, ipag, ... * write a method that uses these prefixes, as is: /^i/, /^pa/, ... As Ken Thompson said, "When in doubt, use brute force". Once this worked, I'd check to see if it was "fast enough". If not, I'd look into reworking the methods. The important issues are (a) getting something working quickly and (b) keeping the implementation details hidden. If speed is a real issue, you may need to go to a fairly fancy solution, so don't tie yourself to regexes! -r -- email: rdm@cfcl.com; phone: +1 650-873-7841 http://www.cfcl.com - Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc.