简体   繁体   English

Javascript正则表达式在开始处仅允许一个加号(+),并且字符串的长度不应超过15个字符数

[英]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.

相关问题 正则表达式只允许两个下划线,没有其他特殊符号并且前一个或下一个字符应该是数字或字母 - Regular expression to allow only two underscores, absence of other special symbols and previous or next character should number or letter 正则表达式只将一个数字替换为字符串 - Regular expression replace only one number into string 电话号码验证正则表达式在开头和前面的数字中包含一个加号 - Phone number validation regular expression consist one plus sign in start and preceding digits 需要正则表达式,只允许有效的页码,如1,2,3,4-5,每个页码的最大长度为3位(1-999) - Need Regular expression that should allow only valid Page Numbers like 1,2,3,4-5 with max 3 digits length of each page number (1-999) JavaScript正则表达式-如何只允许一个连字符? - javascript regular expression - how to allow only one hyphen? Javascript 用于电话号码验证的正则表达式。(字符串仅包含至少 1 个数字、0 个或多个空格和 '-' - Javascript regular expression for phone number validation.(String contains only at least 1 digit, 0 or more spaces and '-' JavaScript 键码只允许数字和加号 - JavaScript keycode allow number and plus symbol only jQuery中的正则表达式仅允许一次匹配 - Regular expression in jquery allow only one match 正则表达式仅允许5位数字或字母字符后跟5位数字 - Regular expression to allow only 5 digit number or alpha character followed by 5 digit number 正则表达式在开始或结束时没有空格,但允许中间有空格但也只允许一个字符输入 - Regular expression for no space at start or end, but allow space in middle but also allow only one char inputs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM