A valid UTF-16 surrogate pair is one character node, although its source range covers two code units. Indexes in the character view count nodes from zero. Whitespace and line endings are ordinary characters, so selection stays faithful to the whole stream.
Lexical mode applies a .NET regular expression with named capture groups. The named group supplies a token kind, while the complete match supplies the span. Unmatched gaps become text, so token spans partition and reconstruct the current view. Empty matches are rejected and regex evaluation has a timeout; this remains lexical matching, not a full parser.
textchars examples/assignments.txt /input:file '/pattern:(?<number>\d+)' /q:'lex[name=number]' /plain /join:', '