On Monday, April 29, 2002, at 07:10 , Bob Showalter wrote:
[..]
>> my $MAXWORD = 15;
>> my $pattern = qr/^\w{1,$MAXWORD}$/;
>
> That matches both "foobar\n" and "foo_bar", which would
> seem to be "illegal" values.

good catch....

I clearly misread what the "\w" would limit on...

> Perhaps the POSIX character class would be useful:
>
>    /^[[:alnum:]]{1,15}\z/
>
> Matches the alphabetic character set in the current locale...

        my $MINWORD = 1;
        my $MAXWORD = 15;
        my $pattern = qr/^[[:alnum:]]{$MINWORD,$MAXWORD}$/;
        ##my $pattern = qr/^[a-zA-Z0-9]{$MINWORD,$MAXWORD}$/;

I had been debating the boring approach of 'if char not in
box' then not in game....

Since that way we can 'grow it' independently as the
security Freaks decide 'must contain one of set.....

also opted to expand it to have the MINWORD value - I
had originally been trying to dink around this with the

        use constant FOO => 'bar';

but that did not take me where I wanted to go.....



ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to