Home >Web Front-end >JS Tutorial >An example of using regular expressions to verify input content in a js input box
js input box input verification
/*用户名称格式判断——用户名只能为下划线、数字、字母或中文长度不超过10个字符*/ function checkUserName(str) { var reg = /^[_0-9a-zA-Z\u4e00-\u9fa5]{1,10}$/; return reg.test(str); }
The above example of the js input box using regular expressions to verify input content This is all the content that the editor has shared with you. I hope it can give you a reference and I hope you will support the PHP Chinese website.
For more examples of js input boxes using regular expressions to verify input content, please pay attention to the PHP Chinese website for related articles!