MS \s help page: \p{Z} does not match ANY separator character
[Enter feedback here] This line is a bit confusing for learners:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/character-classes-in-regular-expressions#whitespace-character-s \p{Z} Matches ANY SEPARATOR CHARACTER.
I suppose you mean: Matches ANY OF THESE THREE separator characters: Zs, Zl, and Zp
If it matched ANY SEPARATOR CHARACTER, I could just enter [^\p{Z}] here:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/character-classes-in-regular-expressions#non-whitespace-character-s „...\S matches any non-white-space character. It is equivalent to the [^\f\n\r\t\v\x85\p{Z}] regular expression pattern...”
(I would not have to list newline, Tab, carriage return, etc... one by one.)
SEE ALSO:
Unicode categories: https://docs.microsoft.com/en-us/dotnet/standard/base-types/character-classes-in-regular-expressions#SupportedUnicodeGeneralCategories
Z = All separator characters. This includes the Zs, Zl, and Zp categories.
I suppose you mean: This ONLY includes the Zs, Zl, and Zp categories.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: a1958bf6-a17d-1256-d659-31066aa02604
- Version Independent ID: 95abea42-fa7f-3feb-ae38-049719ab938f
- Content: Character Classes in .NET Regular Expressions
- Content Source: docs/standard/base-types/character-classes-in-regular-expressions.md
- Product: dotnet-fundamentals
- GitHub Login: @adegeo
- Microsoft Alias: adegeo