Sigh...
I can remember this coming up almost almost a decade ago.
the answer I would prefer is, we, as users of rebol would be able to
completely specify the internal 'stop chars  used by parse in string 
splitting mode.

The answer I have is don't use parse/all for simple string splitting .
Use parse/all but create your own rule block.


note: I find  "terminating" preferable to "separating"
that is : 

<date>|<string>|<url>|

over

<date>|<string>|<url>


then a rule such as:

rule: [(blk: clear blk) 3[copy token to "|"(insert tail blk token) "|"] (blk)]



Peter Carlsson wrote:
> Hello!
>
> I have a databasefile built up by lines with the following structure:
>
> {<date>|<string>|<url>
>
> I parse each line using:
>
>   parse/all <line> "|"
>
> This normally works as expected but with the second line below it seems
> like the parse does something wrong. Or do I miss something?
>
>   
>>> parse/all {2008-10-30|This is OK|http://www.example.com} "|"
>>>       
> == ["2008-10-30" "This is OK" "http://www.example.com";]
>
>   
>>> parse/all {2008-10-30|This "is" OK|http://www.example.com} "|"
>>>       
> == ["2008-10-30" {This "is" OK} "http://www.example.com";]
>
>   
>>> parse/all {2008-10-30|"This is" NOK|http://www.example.com} "|"
>>>       
> == ["2008-10-30" "This is" " NOK" "http://www.example.com";]
>
> It seems that the problem is when a | is directly followed by a ".
>
> Anyone with a solution?
>
> Best regards,
> Peter Carlsson
>   

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to