-
Notifications
You must be signed in to change notification settings - Fork 547
docs: clarify the args of regexReplaceAll and regexReplaceAllLiteral #1738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6d49a80
to
c3ec962
Compare
c3ec962
to
a5b3f01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -905,6 +905,10 @@ replacement string replacement. Inside string replacement, $ signs are | |||
interpreted as in Expand, so for instance $1 represents the text of the first | |||
submatch | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
```yaml |
Maybe set format for these examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TerryHowe Good idea, I'd like to make it, but it's not there in the English version.
Should I make the change to all regex*
sections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format type doesn't seem to matter much here as near as I can tell.
I am not a maintainer on this project and I don't know if they want usage for these.
There are PRs on these methods frequently and I don't exactly know why Sprig docs aren't just included or referenced here https://masterminds.github.io/sprig/strings.html
3395e77
to
eb62ca6
Compare
submatch. The first argument is `<pattern>`, second is `<input>`, and third is | ||
`<replacement>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your PR will have a better chance of merging if you limit it to these two lines and the change on line 922. Try just the english version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TerryHowe Makes sense. I limited the change to that part only.
Thanks for your feedback 🙌
3fc589e
to
19a0eb5
Compare
Signed-off-by: Ahmed AbouZaid <[email protected]>
19a0eb5
to
7aa48c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Hi 👋
I've added a tiny clarification for the
regexReplaceAll
andregexReplaceAllLiteral
functions, as they have an unusual args order (the input is in the middle).That will make the example easier to read.