Back to API Reference
Class
EscapeSequenceRule
sealed
Replaces escape sequences written as plain text with the characters they name: \n a line feed, \r a carriage return, \t a tab, \v a soft line break (U+2028, as <br>), \\ one backslash, \uXXXX the UTF-16 code unit and \UXXXXXXXX the Unicode scalar their four or eight hex digits give. A backslash that starts none of these stays as written.
Remarks
Text from spreadsheet, CSV and JSON localization tables often carries these sequences as characters. TextMesh Pro reads the same set under Parse Escape Characters, except that it turns \v into U+000B, also a soft line break. The TMP migrator adds this rule only where the installed TMP read the sequences in text set from code too; elsewhere it decodes them into the serialized text. The rule outranks every rule but the protection ones. Text-mode LaTeX loses with it: \textbf, \newline, \noindent, \tiny, \vspace, \raggedright and \toprule lose their first letter to a tab, line feed or carriage return, and \\, a line break and a table row end there, becomes one backslash. Formulas inside math spans and protected ranges keep their content. Standalone rule — register via UniTextBase.AddRule without a modifier.
public override int TryMatch(ReadOnlySpan<char> text, int index, PooledList<ParsedRange> results)