String & delimit

Dan murpsoft at hotmail.com
Tue Apr 3 11:58:07 PDT 2007


Gregor Kopp Wrote:

> import std.string;
> import std.stdio;
> void main()
> {writefln(split(split(
> "blablabla thisis a string example <i_need_this_text> ole!"
> , "<")[1],">")[0]);}
> SCNR!!!
> Maybe a Regex would be better, if you just want to do textprocessing?
> 
> in good fun, Gregor

In good fun??  Good!

In JavaScript, I think I write it something like:

"blablabla thisis a string example <i_need_this_text> ole!".match(
/<([^>]+)>/m)[1];

I haven't done any web data mining for a while now, so I can't remember what [#] to use for first sub-match.  : p



More information about the Digitalmars-d mailing list