开发者

Flex TextInput restrict: Restrict punctuation

I have need to restrict user input. TextInput should 开发者_高级运维restrict all special characters and punctuation. Any other characters are allowed. In java there is a regex patter:

replaceAll("\\p{Punct}", "_")

Is there something similar in actionscript?


Use the restrict property:

<s:TextInput restrict="a-z0-9" />


This should be the equivalent of {Punct}

string = string.replace(/[!"#$%&'()*+,-.\/:;<=>?@[\]^_`{|}~]/ig, "_");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜