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

◆ TryGetSingleUnicodeCategory()

static bool System.Text.RegularExpressions.RegexCharClass.TryGetSingleUnicodeCategory ( string set,
out UnicodeCategory category,
out bool negated )
inlinestatic

Definition at line 652 of file RegexCharClass.cs.

653 {
654 if (set[2] == '\u0001' && set[1] == '\0' && !IsSubtraction(set))
655 {
656 short num = (short)set[3];
657 if (num > 0)
658 {
659 if (num != 100)
660 {
661 category = (UnicodeCategory)(num - 1);
662 negated = IsNegated(set);
663 return true;
664 }
665 }
666 else if (num < 0 && num != -100)
667 {
668 category = (UnicodeCategory)(-1 - num);
669 negated = !IsNegated(set);
670 return true;
671 }
672 }
673 category = UnicodeCategory.UppercaseLetter;
674 negated = false;
675 return false;
676 }
static bool IsSubtraction(string charClass)

References System.Text.RegularExpressions.RegexCharClass.IsNegated(), and System.Text.RegularExpressions.RegexCharClass.IsSubtraction().

Referenced by System.Text.RegularExpressions.RegexCompiler.EmitMatchCharacterClass().