[EMAIL PROTECTED] wrote:
> Hi
> The question:
>
> Why if
> parse "the radio" ["the" "radio"]
> parse "the radio" ["the" "radio"]
> parse " the radio" ["the" "radio"]
>
> are all true,
>
> parse " the radio " ["the" "radio"]
>
> is false?
I think it's because of how rules are applied. The first rule says, -
does "the" matches the input string? If so, it ignores spaces, and tries
to do second part of your rule, so it tries to match "radio".
Try this:
space: #" "
parse " the radio" [any space "the" "radio"]
;hmm, I thought even "some space" should work, but it doesn't. It also
count for the space at the end of the string:
space: #" "
parse " the radio " [any space "the" "radio" any space] ;or
space: #" "
parse " the radio" [any space "the" "radio" to end] ; or
space: #" "
parse " the radio" [thru "the" "radio" to end]
but i think parse should ignore spaces in the beginning and in the end
of the string, as it ignores them between the words. Or just use trim on
your string:
->> parse trim " the radio " ["the" "radio"]
== true
Hope this helps,
Regards,
-pekr-
>
>
> Thank you
>
> --
> Luis Marzulli
> e-mail: [EMAIL PROTECTED]
> Caracas, VENEZUELA
> ----------------------------------------------------------
> Earn money when you or your friends are on the Web
> click --> http://www.alladvantage.com/go.asp?refid=BXX890