docs
docs copied to clipboard
Character group gotcha
Can the character groups section include a note that if you want to match a hyphen ('-'), that it must be included first or last in the group? Otherwise it is treated as a range and is not matched.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 16d4698e-4220-c422-a554-8a481803d240
- Version Independent ID: f0e3b82a-8d81-ad9e-97fc-efb92f7d0d38
- Content: Regular Expression Language - Quick Reference
- Content Source: docs/standard/base-types/regular-expression-language-quick-reference.md
- Product: dotnet
- Technology: dotnet-standard
- GitHub Login: @rpetrusha
- Microsoft Alias: ronpet
Thanks for your suggestion, @sethrandall. The Quick Reference page is the wrong place to include this level of detail, though. However, it is important to note, as is the fact that the first character in a range must have the lower code point and the second the higher code point. I've added those details to the Character Classes in Regular Expressions article.