Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CharInCategory()

static bool System.Text.RegularExpressions.RegexCharClass.CharInCategory ( char ch,
string set,
int start,
int setLength,
int categoryLength )
inlinestaticprivate

Definition at line 949 of file RegexCharClass.cs.

950 {
951 UnicodeCategory unicodeCategory = char.GetUnicodeCategory(ch);
952 int i = start + 3 + setLength;
953 for (int num = i + categoryLength; i < num; i++)
954 {
955 int num2 = (short)set[i];
956 if (num2 == 0)
957 {
959 {
960 return true;
961 }
962 }
963 else if (num2 > 0)
964 {
965 if (num2 == 100)
966 {
967 if (char.IsWhiteSpace(ch))
968 {
969 return true;
970 }
971 }
972 else if (unicodeCategory == (UnicodeCategory)(num2 - 1))
973 {
974 return true;
975 }
976 }
977 else if (num2 == -100)
978 {
979 if (!char.IsWhiteSpace(ch))
980 {
981 return true;
982 }
983 }
984 else if (unicodeCategory != (UnicodeCategory)(-1 - num2))
985 {
986 return true;
987 }
988 }
989 return false;
990 }
static bool CharInCategoryGroup(UnicodeCategory chcategory, string category, ref int i)

References System.ch, System.Text.RegularExpressions.RegexCharClass.CharInCategoryGroup(), System.Text.RegularExpressions.i, and System.start.

Referenced by System.Text.RegularExpressions.RegexCharClass.CharInClassInternal().