I just found out it will work if you escape the curly brackets with a
backslash, also, the leading and trailing / characters appear to be
unnecessary:
<mx:RegExpValidator 
        source="{client}" property="text" 
        expression="^[a-z]\{6,16\}$" flags="g"
        trigger="{client}" triggerEvent="change"
        />
That works in Flex 3, anyway.


mavdzee wrote:
> 
> Hi,
> 
> When I use the RegExpValidator, I want to match to lowercase chars
> with a minimum length of 6 and a maximum length of 16. So why is the
> following expression not working:
> 
> <mx:RegExpValidator 
>         source="{client}" property="text" 
>         expression="/^[a-z]{6,16}$/" flags="g"
>         trigger="{client}" triggerEvent="change"
>         />
> 
> It never matches the regular expression. When I replace {6,16} with +
> it  works as I expect.
> 
> Why does t fail over the bracket notation?
> 
> Cheers,
> Andrej
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/RegExpValidator-problem-tp15924871p15978602.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to