From: Brian Candler Date: 2009-10-15T18:35:52+09:00 Subject: Re: matching against a zillion patterns George George wrote: > My worry is the amount of patterns that i have (exceeding 400) and the > efficiency and sanity of such an approach.What would you advice? I would advise you measure it, with your real regexp and your real data. I would expect that the regexp engine (written in C) would be much faster than something you could cobble together yourself in Ruby. Even 400 times "match C1, skip match C1, match C2, skip, match C1, ..." in C will be very fast. Ideally, see if you can find a true regular expression engine that compiles to a DFA (deterministic finite state automaton). This will never backtrack, looking at each incoming character no more than once. -- Posted via http://www.ruby-forum.com/.