[erlang-questions] Use of regular expressions

David Mitchell monch1962@REDACTED
Thu Oct 30 01:34:33 CET 2008


Do you have a pointer to info about the new Erlang regular expression
module?  I've heard bits and pieces about it, but haven't found any
solid information other than "it's coming, and it'll be better than
the current one".

A large part of what I do is message handling, which involves tearing
apart incoming messages (which might be XML, or binary data, or MQ
data, or Oracle SQL*Net client requests, or ...), examining the
content, then either routing the message to somewhere else, or
extracting content from the incoming message and using it to build a
suitable response.  Regex is the way to go for tearing apart this type
of data (well, if the incoming data is XML, then I'll parse out the
individual field/s I'm interested in first using an XML parser, then
often use regex to extract the info from within individual fields);
I've tried using Erlang's pattern matching to achieve the same result,
but the code required to do so was just too clunky and difficult to
maintain.

At the moment, Perl 5.10 is what I'm using; as of 5.10, the thread
handling is much improved, and Perl's regex handling is basically as
good as it gets.  The limitation is that Perl has no easy way to scale
load across multiple machines, which is an ongoing problem for us.
There's also the broader problem of it being a challenge to write Perl
code that is maintainable, long-term.

I'd really like to be doing this in Erlang, for any number of reasons.
 A more powerful regex module would be a huge help in making this
happen.

Regards

Dave M.

2008/10/30 Robert Virding <rvirding@REDACTED>:
> As the new regular expression module is coming soon and after all the
> discussions on the net of how slow the old module was/is I was just
> wondering how they are used in "real life"? What type of searches are
> typically done on what type of data? Is there a typical usage?
>
> For example do people use regexps to pull apart a small string into
> components, like an URL? Or search for a match in a 100Mb data file? Or
> what? Or all of the above?
>
> I am just curious as to how they are used.
>
> Robert
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list