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

[REBOL] Re: A little parse help

From: syke:amigaextreme at: 20-Aug-2001 22:27

Hi again, I get a really strange behaviour from parse when I try to do this (it's also an explanation to what I'm trying to do). if find content "http://" [ parse/all content [ any [ to "http://" copy URL to "<br>" ( link: rejoin [{<a href="} URL {">} URL {</a>}] replace content URL link ) ] ] ] When I try to do this, Rebol crashes, the processor on the web server hits 100% and the only solution is to stop the webserver and then start it again. However, if I do like this: string: "Test" if find content "http://" [ parse/all content [ any [ to "http://" copy URL to "<br>" ( link: rejoin [{<a href="} URL {">} string {</a>}] replace content URL link ) ] ] ] It works. It seems as if using URL two times within Rejoin will cause Rebol to hang. Any idea as to what is causing this? /Regards Stefan Falk - www.amigaextreme.com ----- Original Message ----- From: "Petr Krenzelok" <[Petr--Krenzelok--trz--cz]> To: <[rebol-list--rebol--com]> Sent: Monday, August 20, 2001 9:42 AM Subject: [REBOL] Re: A little parse help
> > Stefan Falk wrote: > > > Hi, > > I'm kinda tired today ;-) > > > > If I for example have this text: > > > > Quick brown fox jumps !image-brown.gif over the fence > > > > and I want to parse out the image file, I'll just do > > parse text [ any [ thru "!" copy wanted-text to " " ]] > > 1) I think that even your parse rule above is not ever met. 'parse, by
default,
> ommits spaces, so you would be probably better with parse/all here. > 2) I don't know your application, but wouldn't you would be better with
'find?
> e.g. > > ->> start: find/any str "!*.???" > == "!image-brown.gif over the fence" > ->> end: find start " " > == " over the fence" > ->> res: copy/part start end > == "!image-brown.gif" > ->> remove res > == "image-brown.gif" > ->> > > If your string is long, you can reassing its position in a loop, e.g.
str:
> end
and continue in searching another image ... Maybe not so elegant, but ...