No joy yet. I've been testing with index 4 & 5 and you can see one is TextInput.Normal and the other is TextInput.Password. Both have the same regex and neither allows any entry into the field! It seem as soon as I have 2x lookaheads I struggle.
echoMode: index===5 ? TextInput.Password : TextInput.Normal
text: modeltext
valFail: ((!acceptableInput && focus) ? true : false)
visible: index===6 ? false : true
property var valid0: RegExpValidator { regExp: /^.{0,32}$/ }
property var valid1: RegExpValidator { regExp: /^.{0,32}$/ }
property var valid2: RegExpValidator { regExp: /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/ }
property var valid3: RegExpValidator { regExp: /^.{6,32}$/ }
//property var valid4: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W).{8,32}$/ }
//property var valid5: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W).{8,32}$/ }
property var valid4: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z]).*$/ }
property var valid5: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z]).*$/ }
echoMode: index===5 ? TextInput.Password : TextInput.Normal
text: modeltext
valFail: ((!acceptableInput && focus) ? true : false)
visible: index===6 ? false : true
property var valid0: RegExpValidator { regExp: /^.{0,32}$/ }
property var valid1: RegExpValidator { regExp: /^.{0,32}$/ }
property var valid2: RegExpValidator { regExp: /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/ }
property var valid3: RegExpValidator { regExp: /^.{6,32}$/ }
//property var valid4: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W).{8,32}$/ }
//property var valid5: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W).{8,32}$/ }
property var valid4: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z]).*$/ }
property var valid5: RegExpValidator { regExp: /^(?=.*[a-z])(?=.*[A-Z]).*$/ }
To copy to clipboard, switch view to plain text mode
This simple case seems to work...enter anything and when you have a number it's validated. Number does not have to be first.
property var valid4: RegExpValidator { regExp: /^(?=.*[0-9]).*$/ }
property var valid5: RegExpValidator { regExp: /^(?=.*[0-9]).*$/ }
property var valid4: RegExpValidator { regExp: /^(?=.*[0-9]).*$/ }
property var valid5: RegExpValidator { regExp: /^(?=.*[0-9]).*$/ }
To copy to clipboard, switch view to plain text mode
Added after 12 minutes:
I'm thinking there's no way to do this accept a post check. From the help file:
When a validator is set the TextInput will only accept input which leaves the text property in an acceptable or intermediate state. The accepted signal will only be sent if the text is in an acceptable state when enter is pressed.
So how can you leave the text in an intermediate state when you require more than one character and can only enter one character at a time?
So for my full up regex (commented out above). I can paste in with: aA1&. I can not past in with: aA11.
And on the first one....I cannot delete any of the characters. So it seems a post check will be required!
Bookmarks