regex url validator?

Monte Goulding monte at appisle.net
Tue Oct 23 17:40:18 EDT 2018


> On 24 Oct 2018, at 3:29 am, Alex Tweedly via use-livecode <use-livecode at 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






More information about the use-livecode mailing list