We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db2b63c commit e1ee149Copy full SHA for e1ee149
ProtoExport/Utility.cs
@@ -8,6 +8,10 @@ internal static class Utility
8
9
public static readonly string[] splitNotesChars = { "//" };
10
11
+ /// <summary>
12
+ /// 定义正则表达式来匹配以大写字母开头,不允许全部由大写字母组成,不允许存在连续的大写字母,并允许后续字符是小写字母或数字
13
+ /// </summary>
14
+ public const string CamelCasePattern = @"^(?![A-Z]+$)(?!.*[A-Z]{2})[A-Z][a-zA-Z0-9]*$";
15
16
/// <summary>
17
///
@@ -16,10 +20,7 @@ internal static class Utility
20
/// <returns></returns>
21
public static bool IsCamelCase(string str)
18
22
{
19
- // 定义一个正则表达式来匹配 Upper Camel Case 命名规则
- string pattern = @"^[A-Z][a-zA-Z]*$";
-
- return Regex.IsMatch(str, pattern);
23
+ return Regex.IsMatch(str, CamelCasePattern);
24
}
25
26
public static string ConvertType(string type)
0 commit comments