문제

I have a TextInput field that should be restricted to either capital letters, lowercase letters, numbers and underscores. This is the code I'm trying to use to restrict characters:

restrict="\\A-Z\\a-z\\0-9\\ \\_\\-"

I'm using MXML for this Textinput component.

Unfortunately this does not restrict the \ character, which is the last character I'd like to restrict.

How can I add the backslash to the list of restricted characters?

Thanks

Stephen

도움이 되었습니까?

해결책

Actually found the solution I've amended the restrict code to:

restrict="A-Za-z0-9 _\-"

I took out all the back slashes which I thought or was using as delimiters.

Works fine now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top