[REBOL] Re: Parse versus Regular Expressions
From: rotenca:telvia:it at: 3-Apr-2003 20:15
Hi,
> y: [[y #"a"] | #"b"]
>didn't "fire" any error, stack overflow, or any unusual exception.
Nevertheless, it didn't work:
> parse "b" y ; == true
> parse "ba" y ; == false
>Any ideas?
http://www.escribe.com/internet/rebol/m25516.html about recursion limits of
parse
this makes your rule to match this string:
y: [y #"a" | #"b"]
parse head insert/dup tail "b" "a" 200 y ; == true
but also:
parse head insert/dup tail "b" "a" 66 y ; == true
parse "baa" y ; == true
parse "b" y ; == true
it matches "ba..." string where the number of "a" is (200 // (n + 1)) - n = 0
and given the recursion limits the result is the right one.
---
Ciao
Romano