C# 字母数字小写和小写需要正则表达式。及_
我需要一个用于字母数字小写字符的正则表达式,另外它可以包括以下两个字符:C# 字母数字小写和小写需要正则表达式。及_,c#,regex,C#,Regex,我需要一个用于字母数字小写字符的正则表达式,另外它可以包括以下两个字符:和 字符串必须以字母数字小写字符开头和结尾 这些字符不能是连续的:。或。或。或。 示例: helloworlderrr✅ hello\uuu.errr✅ 。您好❌ 你好❌ hel_uuulo❌ 看看这个正则表达式: ^(?!.*(__|\.\.|_\._|\._\.))[a-z0-9][\w\.]+[a-z0-9]$ 看 如果你忘记了“连续”要求,你知道怎么做吗?@PM77-1我不知道该怎么做,所以你需要先学习regex
和
字符串必须以字母数字小写字符开头和结尾
这些字符不能是连续的:。
或。
或。
或。
示例:
✅李>helloworlderrr
✅李>hello\uuu.errr
❌李>。您好
❌李>你好
❌李>hel_uuulo
- 看看这个正则表达式:
看^(?!.*(__|\.\.|_\._|\._\.))[a-z0-9][\w\.]+[a-z0-9]$
如果你忘记了“连续”要求,你知道怎么做吗?@PM77-1我不知道该怎么做,所以你需要先学习regex基础知识。拿起你选择的教程。例如^ Start of string (?!.*(__|\.\.|_\._|\._\.)) Negative lookahead - do not match if contains __ /.. / _._ / ._. [a-z0-9] Match only lowercase alphanumeric [\w\.]+ Match [a-zA-Z_] and dot [a-z0-9] Match only lowercase alphanumeric $ End of string