[英]Javascript Regular Expression allow only one plus (+) sign at start and length of string should not more than 15 character number only
Hello All, 大家好,
I want JavaScript regular expression which allow (+) sign once at start as well as whole length of string should not be more than 15 numeric character ie 0 to 9. 我希望JavaScript正则表达式在开始时允许(+)符号一次,并且字符串的整个长度不应超过15个数字字符,即0到9。
Try this: 尝试这个:
/^\\+\\d{0,14}$/
- if yours string overall length should be maximum of 15 characters long /^\\+\\d{0,15}$/
- if you want '+' and no more than 15 0-9 characters /^\\+\\d{0,14}$/
-如果您的字符串总长度最大为15个字符,则/^\\+\\d{0,15}$/
-如果您想要'+',且不超过15 0-9个字符
You can also experiment on http://regexr.com/ 您也可以在http://regexr.com/上进行实验
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.