Hello [EMAIL PROTECTED]!
On 29-Dic-99, you wrote:
P> very primitive, but worked. I used find/any, but was not
P> satisfied with the result, as t*t would scan the string for
P> the next occurance in the particular news article. Too much
Hmm, this is a bit more challenging. If we are not afraid of
recursion, we can use:
; matching m*cycle
no-space: complement charset " ^-" ; for example
looping-rule: ["cycle" | no-space looping-rule]
parse/all text ["m" looping-rule]
Which gives:
>> parse/all "motorcycle" ["m" looping-rule]
== true
>> parse/all "motor cycle" ["m" looping-rule]
== false
If we want to avoid recursion, we have to use a trick, because
we need to break out of the loop created by 'any.
parse/all text [
"m" mark: any ["cycle" mark: to end | no-space] :mark
]
It's ugly, but it works. I'd like to have something like 'break
for 'any and 'some too...
Regards,
Gabriele.
--
o--------------------) .-^-. (----------------------------------o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ |
o--------------------) `-v-' (----------------------------------o