logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Interesting approach to string parsing: msg#00044

Subject: Re: Interesting approach to string parsing
> http://www.deepwood.net/~drlion/stringx.ml

His sample is interesting :
* 07:04 <@edouard> I am a human being.
* 07:05 <@edouard> @@@ MACRO BUSTER @@@
* You could then define functions for extracting the various parts
* of each line as follows:
* let time = substring (`Before (`Start_of (`First " ")))
* let nick = substring (`Between (`End_of (`First "<"),
* `Start_of (`First ">")))
* let text = substring (`After (`End_of (`First "> ")))

But actually it looks like split is already powerful enough :

let time , str = split str " <" in
let nick , text = split str "> " in

I'm not sure also about the algorithm implementation. A regexp is nice
because it can catch several parts of a string after a single match. Looks
like this library need multiple matches.

Regards,
Nicolas Cannasse



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.

Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>