Re: The length of search

Arto Pastinen <[email protected]> Sat, 22 Nov 2003 14:48:26 +0200
Newsgroups gmane.comp.jakarta.regexp.user
Message-ID <[email protected]>
Ok, so how this lookahead works? or hints some good guides in net??

Artsi

On Sat, 22 Nov 2003 13:40:37 +0100, Schamil Wackenhut <[email protected]> wrote:

> * Arto Pastinen wrote:
>
>> Why:
>>
>> RE re = new RE([:alnum:]{3,8});
>> re.match("123456789");
>>
>> .. returns true?
>
> Because there are 3-8 [:alnum:] characters in your string.
>
>> .. and is there any way to get false current situation?
>
> re.match("12");
>
>> I need to make some security checks for form parameters, and
>> i need to check that parameter contains 3-8 characters, and regexp
>> seems quite handy for that.
>
> Not more, not less? I think you need lookahead for this task.
>