[REBOL] Re: 'Parse is peculiar!
From: al:bri:xtra at: 14-Dec-2000 21:51
SpliFF wrote:
> >> line1: {Lets find "Julie<1234>"}
> >> parse line1 [thru {"} copy name [thru {<} 4 digits {>} (print name)] to
end]
> Julie<1234>
> == true
>
> but what if I don't want to include the <xxxx> in 'name?
>> parse line1 [thru {"} copy Name to "<" "<" 4 digits {>"} end (print
Name)]
Julie
== true
A nicer way would be:
>> parse line1 [thru {"} copy Name to ["<" 4 digits {>"}] end (print Name)]
** Script Error: Invalid argument: < 4 digits >"
** Near: parse line1 [thru {"} copy Name to ["<" 4 digits {>"}] end (print
Name)]
but unfortunately, 'to isn't yet smart enough to understand a block of
rules.
Andrew Martin
ICQ: 26227169 http://members.nbci.com/AndrewMartin/