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

◆ ParseProperty()

string System.Text.RegularExpressions.RegexParser.ParseProperty ( )
inlineprivate

Definition at line 1455 of file RegexParser.cs.

1456 {
1457 if (CharsRight() < 3)
1458 {
1459 throw MakeException(RegexParseError.InvalidUnicodePropertyEscape, System.SR.InvalidUnicodePropertyEscape);
1460 }
1461 char c = RightCharMoveRight();
1462 if (c != '{')
1463 {
1464 throw MakeException(RegexParseError.MalformedUnicodePropertyEscape, System.SR.MalformedUnicodePropertyEscape);
1465 }
1466 int num = Textpos();
1467 while (CharsRight() > 0)
1468 {
1469 c = RightCharMoveRight();
1470 if (!RegexCharClass.IsWordChar(c) && c != '-')
1471 {
1472 MoveLeft();
1473 break;
1474 }
1475 }
1476 string result = _pattern.Substring(num, Textpos() - num);
1477 if (CharsRight() == 0 || RightCharMoveRight() != '}')
1478 {
1479 throw MakeException(RegexParseError.InvalidUnicodePropertyEscape, System.SR.InvalidUnicodePropertyEscape);
1480 }
1481 return result;
1482 }
static string InvalidUnicodePropertyEscape
Definition SR.cs:40
static string MalformedUnicodePropertyEscape
Definition SR.cs:54
Definition SR.cs:7
RegexParseException MakeException(RegexParseError error, string message)

References System.Text.RegularExpressions.RegexParser._pattern, System.Text.RegularExpressions.RegexParser.CharsRight(), System.SR.InvalidUnicodePropertyEscape, System.Text.RegularExpressions.RegexCharClass.IsWordChar(), System.Text.RegularExpressions.RegexParser.MakeException(), System.SR.MalformedUnicodePropertyEscape, System.Text.RegularExpressions.RegexParser.MoveLeft(), System.Text.RegularExpressions.RegexParser.RightCharMoveRight(), and System.Text.RegularExpressions.RegexParser.Textpos().

Referenced by System.Text.RegularExpressions.RegexParser.ScanBackslash(), and System.Text.RegularExpressions.RegexParser.ScanCharClass().