[Newbies] Re: ByteString>>match: greedyness of * ??
nicolas cellier
ncellier at ifrance.com
Tue Jan 8 20:24:19 UTC 2008
This behavior is squeakish, other Smalltalk match differently:
VW: '**' match: 'e'. "true"
gst: '**' match: 'e'. "true"
Anyway, this pattern matching is limited. How do you match a '*' itself?
I thought your example might be interpreted as an escape sequence, but
no, there is no escape in this simple matching.
'**' match: '*'. "false"
'\*' match: '*'. "false"
Try VBregex or another regex package.
Nicolas
Ch Lamprecht a écrit :
> Hello,
>
> I found the following results for some expressions using #match:
>
> 'e' match: 'e'. "true"
> '*' match: 'e'. "true"
> '#' match: 'e'. "true"
>
> '*e' match: 'e'. "true"
> '*#' match: 'e'. "false"
> '**' match: 'e'. "false"
>
> '*' match: ''. "true"
> '**' match: ''. "false"
>
>
> Is this expected behavior?
> Looks like * is sometimes 'greedy', sometimes not. (Comparing 4 and 5)
> Thank you for any hints.
>
> Christoph
More information about the Beginners
mailing list