-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docs(external): Updated replace
capture group example
#18785
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
Conversation
updating the example for the capture group name in the example to use $$num instead of $num as single $ does not work. Also need to provide more description on the Note. "Note that $foo is interpreted in a Vector configuration file, instead use $$foo." This isn't clear, and not sure what it means.
✅ Deploy Preview for vector-project ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for vrl-playground canceled.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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 a bit tricky because the example is correct, as-is, when used outside of a Vector configuration file (e.g. vector vrl
or the VRL playground). It is just that in configuration files you need to escape the $
to avoid it being interpreted as an environment variable.
I think the title of this example should be updated to indicate that this is how it should be written when in a config file only.
Added additional example for Replace with capture group to give an example of calling capture groups in a configuration file and outside a configuration file so it is clear.
@jszwedko I've updated the the pull request so it has an example of both with the titles updated |
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 @pezkins !
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 both! Just a couple of some edits for clarification. Let me know if I changed the meaning.
Co-authored-by: May Lee <[email protected]>
Co-authored-by: May Lee <[email protected]>
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 @pezkins, LGTM!
wait do the examples actually get tested (which makes sense) but that means that the "in configuration" file example can't fails as the task probably just tests the example with vre/playground. @jszwedko what happens now? |
Ah, yes, I forgot the examples are tested in CI. I would back out the added example then and just add a note to the existing one that an extra |
1720078
to
ffe54be
Compare
replace
capture group example
18f3055
updating the example for the capture group name in the example to use $$num instead of $num as single $ does not work. Also need to provide more description on the Note. "Note that$foo is interpreted in a Vector configuration file, instead use $ $foo." This isn't clear, and not sure what it means.