docs icon indicating copy to clipboard operation
docs copied to clipboard

Character group gotcha

Open sethrandall opened this issue 7 years ago • 1 comments

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.

sethrandall avatar May 06 '19 16:05 sethrandall

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.

rpetrusha avatar May 06 '19 22:05 rpetrusha