So what? Seems the application that's going to use the block of paragraphs
could easily deal with the "" for an empty paragraph. To me, that's
preferable than trying to outguess the final character of every conceivable
paragraph!
Russell [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 20, 2000 10:00 PM
Subject: [REBOL] parse or Re:(4)
> Ahh, but this is not enough, because if the report has more than one
newline
> character following a paragraph, you will end up with empty paragraphs.
>
> >> But what if I'm trying to parse a report and wish to make each
> >> paragraph a separate string within a block?
> >
> >Simple parsing with the /all refinement will do this in one step. The
/all
> >refiinement disables all the default delimiters and uses only the
supplied
> >string of characters to break apart the target string. In this case,
we'll
> >use the control character "^/", end of line, commonly used to end a
> >paragraph.
> >
> >A console session follows that illustrates this. ( Note I've inserted an
> >extra "test" period within the first paragraph.)
> >
> >>> paragraphs: {First. paragraph.^/Second "paragraph."^/Third paragraph.}
> >== {First. paragraph.
> >Second "paragraph."
> >Third paragraph.}
> >
> >>> ; Now apply the simple parse/all with only the single break character
> >"^/"
> >
> >>> parse/all paragraphs "^/"
> >== ["First. paragraph." {Second "paragraph."} "Third paragraph."]
> >
> >end of console session.
> >
> >This seems to be just what is wanted. {}'s are used for the second item
> >because it included " 's. The period at the end of First is ignored,
along
> >with all the other spaces, ", etc because the /all refinement disabled
the
> >usual default break chars.
>