简体   繁体   English

如何定义字符串开头不存在的字符?

[英]How to define a character is not there at starting of string?

var rgex= /^[\\+\\w.-]/ ;

This works for ss1 , s , s+ss .这适用于ss1ss+ss But I want to make sure its giving false for +san .但我想确保它为+san提供 false 。

Choose the first character in a class that doesn't contain + :选择不包含+的类中的第一个字符:

var rgex= /^[\w.-][+\w.-]*/ ;

May be you want to anchor the end of the string:可能您想锚定字符串的结尾:

var rgex= /^[\w.-][+\w.-]*$/ ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM