Skip to content

regexp: doc: lead with the precise syntax rather than referring to Perl, Python, etc. #39405

Description

@Jarch09

What version of Go are you using (go version)?

1.13.5

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env darwin/amd64
$ go env

What did you do?

  • Regexp is not catching all of the whitespace values that is should
  • In particular \s is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions