golang/go
GitHub で見るregexp: doc: lead with the precise syntax rather than referring to Perl, Python, etc.
Closed
#39,405 opened on 2020年6月4日
DocumentationNeedsFixhelp wanted
Repository metrics
- Stars
- (133,883 stars)
- PR merge metrics
- (30d に merged PR はありません)
説明
What version of Go are you using (go version)?
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
What did you do?
- Regexp is not catching all of the whitespace values that is should
- In particular
\sis not matching hair spaces (whereas perl regex does)
Here's a go playground link
What did you expect to see?
It should match the white space.
What did you see instead?
It did not recognize the hair space as valid white space.
If this is indeed the intended behavior, the docs should be more clear that golang's regex does not conform with perl's and will not match all of the standard regex special characters.
If the docs already say this loudly and clearly and I just missed that section, apologies for being an idiot.