2009/10/16 George George <george.githinji / gmail.com>: > Robert Klemme wrote: >> 2009/10/15 George George <george.githinji / gmail.com>: >>> >>> depending on which pattern the string contains. >> Looks like this is tricky to become right. ¨ֲטועו ףוום פן גו ףןםו >> people around that do bioinformatics, maybe some of them do have a >> solution already. >> >> Things you could do off the top of my head: since it seems your >> patterns are only strings you could optimize the pattern by building a >> trie from it and then creating a RX from that. ¨ֲ§צהןמו פטיף גוזןעו >> (see below). ¨ֲהצבמפבחו יף פטבפ שןץע עוחץלבורנעוףףיןמ חופף ףםבללו>> and matching becomes more efficient (because of eliminated >> backtracking for NDA based RX engines). > > Thank you so much Robert! I have tried your approach and compressed the > patterns to a single regular expression. (removed backtracking). And what did it do to performance? How many patterns do you need now or were you able to squeeze everything into one? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/