[英]Regular expression which accepts 'whitespace' character as well
This is my regular expression. 这是我的正则表达式。 But it does not accept white space. 但是它不接受空格。 How to modify it so that it will accept white space in the middle or end but should not accept only white spaces. 如何修改它,使其在中间或结尾接受空白,但不应仅接受空白。
/^[a-zA-Z]+[a-zA-Z0-9._-]+$/'
The following should work for you. 以下应为您工作。 It will allow whitespace after the first character. 它会在第一个字符后留空格。 ^[a-zA-Z]+[a-zA-Z0-9\\s._-]+$
ya i got the solution.I modified the regex in the following way and this is working fine. 是的,我得到了解决方案。我以以下方式修改了正则表达式,这工作正常。 Anyway thanks :) 还是谢谢你 :)
/^[a-zA-Z]+[a-z A-Z0-9._-]+$/'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.