Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Fwd: Re: Re: Parse problem

From: Patrick::Philipot::laposte::net at: 8-Oct-2005 20:35

Bonjour Peter, Thank you for your code. Being a lazy guy, I was hoping to get advantage of block parsing. Block parsing is able to match a type, the type being url! in my case. Example :
>> ablock: [foo dummy foo] >> parse ablock [ some [set u url! (print u) | skip]] So finally, my solution is : s: {Go see, it is fabulous. And with my photos} bs: parse s none remove-each w bs [not parse to-block w [url!]] foreach w bs [ replace find s w w rejoin [{<a=href"} w {">} w {</a>}] ] print s Go see <a=href""></a>, it is fabulous. And <a=href""></a> with my photos I'm pretty sure this code is not optimized and that some guru could make a one liner of it. Anyway it will do the job the way I like. -- Ciao Patrick