On 7/31/05, Kai Peters <[EMAIL PROTECTED]> wrote:
>  Hi Parsers ~ =3DA0 why does parse below not return=3D true? =3DA0 Thanks=
, Kai =3DA0
> =3DA0 >>=3DA0st: "Kai was=3D here" =3D3D=3D3D "Kai was here" >>=3DA0parse=
/all st [ thru=3D
> "ai" copy chunk to "here" ] =3D3D=3D3D false >>=3DA0probe=3D chunk " was =
" =3D3D=3D3D "
> was " >>

str: {
Hi Parsers ~ =3DA0 why does parse below not return=3D true? =3DA0 Thanks, K=
ai =3DA0
=3DA0 >>=3DA0st: "Kai was=3D here" =3D3D=3D3D "Kai was here" >>=3DA0parse/a=
ll st [ thru=3D
"ai" copy chunk to "here" ] =3D3D=3D3D false >>=3DA0probe=3D chunk " was " =
=3D3D=3D3D "
was " >>
--}

letternum: charset[#"A" - #"Z" #"0" - #"9"]
parse/all str[=20
=09any[to "=3D" [p: "=3D" 2 letternum (remove/part p 3) :p ] | skip]
]
replace/all str " >>" "^/!>>"
replace/all str "=3D " " "
? str
{
STR is a string of value: {
Hi Parsers ~  why does parse below not return true?  Thanks, Kai=20

!>>st: "Kai was here"  "Kai was here"
!>>parse/all st [ thru=3D
"ai" copy chunk to "here" ]  false
!>>probe chunk " was "  "
was "
!>>
--}

Ok, now i get it. :)
because the string must match upto the end.=20
In your example the parsing goes to the "here", not thru,=20
so not skipping it. you must skip that yourself. Some variants:
 to "here" to end ;; not exact, stuff can follow after "here"
 to "here" "here" ;; goes to "here" and then skips
 to "here" 4 skip ;;  ""
its somewhat ugly, having something like this would be nice:
 to "here" skip-last
}

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


--=20
-Volker

"Any problem in computer science can be solved with another layer of
indirection. But that usually will create another problem." David
Wheeler
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to