Hi Bill,
I'm sorry, I can't work out what you are trying to achive here.
The rules area-code and phone-num cannot be satisfied by the data you have
presented in str - or is that the point?
Can you provide a bit more information on what exactly you are trying to do.
However taking a stab at something that might help...
The data you have in str appears like it might be PABX records - if the
records are identical in structure it might be easier to tream them a line
at a time.
For example you could read them in with
block-of-lines: read/lines %pabx-data.dat
Then you get a block of lines.
Equivalently using your existing data
block-of-lines: parse/all str "^/"
Playing with each line individually
>> parse second block-of-lines none
== ["28/11/00" "27.13" "28.00" "26.81" "27.81" "+0.93" "2668900"]
Maybe you know that phone-number will always be the 7th field in the record,
so...
>> pick (parse second block-of-lines none) 7
== "2668900"
Cheers,
Brett.
----- Original Message -----
From: "bill" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 08, 2001 9:44 AM
Subject: [REBOL] Parse
> I've been busting my head for a while now against parse.
> I've been able to get simple rules to work famously and am able
> to get a lot of good results,,, but .
> Could someone please tell me where I'm going wrong here.
> If I run the following script the first parse is happy
> the second is not.. I have not been able to figure out what
> the proper way to do this is and I have spent too long at this.
>
> Thanks
> Bill.
>
> Using REBOL v 2.3.0.3.1
> REBOL [
> Title: "Test"
> Author: "Gyrus"
> Date: 3/02/2001
> Version: 0.1
> File: %test.r
> ]
>
> str: {
> 28/11/00 27.13 28.00 26.81 27.81 +0.93 2668900
> 27/11/00 26.31 27.63 26.25 26.88 +0.75 4346600
> 24/11/00 26.56 27.13 25.88 26.13 unch 810500
> 22/11/00 26.25 26.44 25.88 26.13 -0.12 1757300
> }
>
>
> digits: charset "0123456789"
> area-code: ["(" 3 digits ")"]
> phone-num: [3 digits "-" 4 digits]
>
>
> print parse str [ [area-code | none] phone-num]
>
> print parse str [ copy text to [area-code | none] phone-num]
>
> wait 10
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.