Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Performance problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-05-14 (23:13)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] Performance problem
On Thu, May 15, 2003 at 01:13:48AM +0300, Ville-Pertti Keinonen wrote:
> Regular expressions can be much slower than you might expect for 
> non-trivial cases.  The expression in your program looks particularly 
> nasty, since there are a lot of ambiguous cases (whether '-' should 
> match '.*' or '-' depends on everything that follows).
> You might want to try using Str.split instead.

Yes, that works well. Considering the number of times I've seen Python
gurus admonishing newbies to use simple string functions instead of
regexes whenever possible (and have probably admonished a few myself),
you'd think I would have thought of that. But all's well that ends well,
I guess.

Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through           its fields;   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                            --Lao Tzu (Peter Merel, trans.)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: