James Lynes <jmlyne...@gmail.com> writes:

> print Dumper($timeval) says:
>     $VAR1 = bless( {
>                  'data' => \'10:00',
>                  'validate' => qr/(?^:(\d+:))/
>                }, 'LCDAlarmClockDialog::Validator' );
>
> 1. Not sure what the pre-pended ?^: means. It was added by
> Wx::Perl::TextValidator
>
> 2. I have tried a number of regex strings:
>       (\d+)              allows entry of numbers
>       (:)                  allows entry of colons
>       (\d+:)             allows no entry at all
>      (\d+:\d+)         allows no entry at all
>      (\d{2,}:\d{2,})    allows no entry at all
>

It's a long time ago that I playes with Validators, but I seem to recall
that there was something with the moment the test was applied. 
The validator is really a filter, so it restrics what characters can be
input. When you try (\d+:) then youy're matching more than one character
against the input, which will always fail since the input initially is
empty and the first character will never match the pattern.

So the validator pattern should be sort of character class, e.g. [\d:]
and you need an additional end-form validator ^(\d{2,}:\d{2,})$ in
TransferFromWindow.

-- Johan

Reply via email to