You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for regexp.ReplaceAllString say that it interprets $ as in Expand. The docs for Expand say "a variable is denoted by a substring of the form $name or ${name}, where name is a non-empty sequence of letters, digits, and underscores." The names are for use with the (?P<name>re) syntax. So when you write $1_, ReplaceAllString is substituting the value of the variable 1_, which is empty. You need to write ${1}_.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Assuming playground uses it - yes: https://play.golang.org/p/THIwTK5zXpW
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/THIwTK5zXpW
What did you expect to see?
second output should produce
somerandomtext_
but produces nothingWhat did you see instead?
RE2 issue: google/re2#209
The text was updated successfully, but these errors were encountered: