简体   繁体   English

Javascript正则表达式匹配不匹配的字符串

[英]Javascript Regexp to match a string which isn't

Given this regexp: 鉴于此正则表达式:

@([a-z0-9_-]{3,})

I don't want it to match if the pattern is "SpecialUsername". 如果模式为“ SpecialUsername”,则我不希望其匹配。

@Tom = match
@SpecialUsername = no match
@Another = match
etc

How do I modify it for this special case? 如何针对这种特殊情况进行修改?

(?!SpecialUsername)([a-z0-9_-]{3,})

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

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