Hey. I have a problem with regex. I have a RegExpValidator in MXML and I want this to be wrong when the source contains a or b. My RegExpValidator
<mx:RegExpValidator source="{value}"
property="text"
expression='.*[^ab].*'
valid="isValid(event)"
invalid="isInvalid(event)"/>
My expression expression='.*[^ab].*'
When it is just a, b or and b (one or more times), the expression is invalid: OK
When it is all the rest, the expression is valid: OK
But when it is a or b and b with another caractere, it also works. What do I need to change to make this invalid?
Snote source
share