[REBOL] parsing text???? Re:
From: chris:ross-gill at: 25-Aug-2000 12:45
Hi Stephane,
> I have the following text
> dog.eat.dog.eat.cat.eat.fish
> dog.eat.dog.eat.cat.eat.fish?but no
> dog.eat.dog.eat.cat.eat.fish"really
> dog.eat.dog.eat.cat.eat.fish
> dog.eat.dog.eat.cat.eat.fish"mmmm
> dog.eat.dog.eat.cat.eat.fish
> and am using the following code to parse it:
> html-code: [
> thru newline copy url to {?|"|newline} (append urls url) |
> copy txt to newline (append text txt)
> ]
> page: read %emails.txt
> parse page [ to newline copy url some html-code (append urls url) ]
> it freezes I tried many combination but just cannot get the whole txt
> only parts at the time or parts of the original file.
> help
> Stephane
How about:
page: read/lines %emails.txt
text: copy []
urls: copy []
;an just stands for alphanumeric
an-chars: charset [#"a" - #"z"] ;add more, this is a simple example
an-text: [some an-chars]
an-url: [an-text some ["." an-text]]
rule: [
copy url an-url (append urls url) any [
["?" | {"}] copy txt an-txt (append text txt)
]
]
foreach line page [parse line rule]
I'm not sure if this entirely addresses your question.
- Chris