[erlang-questions] word filtering

Wed Jun 6 02:50:43 CEST 2007

On 5 Jun 2007, at 4:00 pm, shehan wrote:
> I want to write spam detecting (word filtering) function. I already  
> know
> that regexp can be used for that & it is just string comparing & too
> slow when used in high volume usage.(ex: 500 text messages/sec) Can
> somebody tell me that, is there any method in Erlang to filter words
> faster than regexp?

There are regular expressions, and then again, there are regular
expressions.  More precisely, there are various regular expression
library modules for Erlang, which all build some kind of data
structure which has to be interpreted at run time, but there is also
Leex, an Erlang equivalent of lex/flex.  See

What you get with Leex is Erlang source code which you can compile
as usual (even to native code, using HiPE).  I would expect this to
cope with 500 text messages per second.

There are other approaches.

More information about the erlang-questions mailing list