-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Docs: regex+replacement hints for URL rewriting #2802
Conversation
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.
Thanks for your contribution 👍
docs/configuration/entrypoints.md
Outdated
@@ -120,6 +120,14 @@ To redirect an entrypoint rewriting the URL. | |||
!!! note | |||
Please note that `regex` and `replacement` do not have to be set in the `redirect` structure if an entrypoint is defined for the redirection (they will not be used in this case). | |||
|
|||
`regex` and `replacement` follow the rules as per [matchers](/basics/#matchers) |
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.
This is false, because in matchers we use goriila/mux regex, it's not the same syntax.
Could you remove this sentence.
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.
Oh thats interesting, have added your extra comment about how they are different
docs/configuration/entrypoints.md
Outdated
@@ -120,6 +120,14 @@ To redirect an entrypoint rewriting the URL. | |||
!!! note | |||
Please note that `regex` and `replacement` do not have to be set in the `redirect` structure if an entrypoint is defined for the redirection (they will not be used in this case). | |||
|
|||
`regex` and `replacement` follow the rules as per [matchers](/basics/#matchers) | |||
|
|||
Specifically the `replacement` rule uses [Go Regexp.ReplaceAllString](https://golang.org/pkg/regexp/#Regexp.ReplaceAllString) |
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.
Could you remove this sentence.
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.
Done
docs/configuration/entrypoints.md
Outdated
|
||
Specifically the `replacement` rule uses [Go Regexp.ReplaceAllString](https://golang.org/pkg/regexp/#Regexp.ReplaceAllString) | ||
|
||
Care should be taken when defining replacement expand variables; `$1x` is equivalent to `${1x}`, not `${1}x` [see Regexp.Expand](https://golang.org/pkg/regexp/#Regexp.Expand) |
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.
could you replace the ;
by :
And replace [see Regexp.Expand]
by see [Regexp.Expand]
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.
Done, plus added your Regex101 example from the original issue (missed that you had added that as I only saw the first github email notification)
docs/configuration/entrypoints.md
Outdated
@@ -1,4 +1,4 @@ | |||
# Entry Points Definition | |||
# Entry Points Definition |
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 don't see any change on this line, could you restore the previous state of this line.
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.
Couldnt see where this was injected in dev tools, have tweaked via github to remove
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
b93d174
to
8e5df63
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
8e5df63
to
0f0b031
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
0f0b031
to
9ba83c6
Compare
What does this PR do?
Documentation - hints for regex replacement
Motivation
Related to #2796
More
Additional Notes
Not sure if you would want the extra link to the Go Playground for testing regex/replacements