> On 24 Oct 2018, at 3:29 am, Alex Tweedly via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Hi Sean,
> 
> I think there are two (hopefully straightforward) suggestions for the docs on 
> this:
> 
> 1. the syntax diagram is (I think) wrong (or at least misleading) ....
> 
>> filter [{lines | items | keys | elements} of] *filterSource* {with | without 
>> | [not] matching} [{wildcard pattern | regex pattern}] *filterPattern* [into 
>> *targetContainer*]
>> 
> in particular, the bit that says  ....  [{wildcard pattern | regex pattern}]  
> ....
> 
> It implies that it is optional to have anything there - and that if you do, 
> then it can be either one or the other.  Nothing there indicates that the 
> alternatives are
> 
> alternative one:   "wildcard pattern" or nothing,
> alternative two:  "regex pattern".
> 
> Maybe it could be
> 
> filter [{lines | items | keys | elements} of] *filterSource* {with | without 
> | [not] matching} {[wildcard pattern] | regex pattern} *filterPattern* [into 
> *targetContainer*]
> 
> (i.e. moving the option [...] inside the alternate {...} - which I think 
> gives equivalent possibilities, but makes it clearer which is which;  clearer 
> at least to me :-)


Hmm… the syntax just describes valid syntax rather than how it behaves so I’m 
not sure if the change suggested above adds much.

The docs do state:

If a regex pattern is specified, the filterPattern evaluates to a regular 
expression.

Perhaps we just need a note stating that the pattern is presumed to be a 
wildcard if the pattern type is not explicitly specified via regex pattern or 
wildcard pattern.

Cheers

Monte



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to