需要正则表达式 4-12 个字母数字字符或特殊字符 (~!@$%&*_+) 至少一个字母,没有空格

Need regular expression for 4-12 alphanumeric characters or special characters (~!@$%&*_+) at least one letter, no spaces

本文关键字:一个 空格 数字字符 4-12 正则表达式 特殊字符 amp      更新时间:2023-09-26

请参阅以下示例,这些示例需要满足正则表达式。

规则:4-12 个字母数字字符或特殊字符 (~!@$%&*_+) 至少一个字母,不能有空格

test                  ---------This is Valid
test@2                ---------This is Valid 
test2                 ---------This is Valid
2222                  ---------This is NOT Valid
2222@                 ---------This is NOT Valid 
@2222                 ---------This is NOT Valid
test user2            ---------This is NOT Valid
testUser              ---------This is Valid
testUser@2            ---------This is Valid 
testUser2             ---------This is Valid
testUser.2            ---------This is NOT Valid

这可能有效

/(?! )(?=.*[a-zA-Z])[a-zA-Z~!@$%&*_+]{4,12}/g

演示