vectordotdev / vectordotdev/vector
chore(docs): update docs for VRL's `replace` to explain escaping capture group references
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
The VRL replace function allows specifying capture group references in the replacement string, which works fine when following the examples in the VRL documentation. Specifically, the examples cover using a single group reference.
However, the documentation/examples do not cover how to use the group references when there is no whitespace surrounding them, which requires curly brackets to disambiguate. Without braces, something like $$ref1strhere$$ref2 ends up simply getting replaced as if the replacement value was $$ref2... whereas $${ref1}strhere$${ref2} works as expected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the VRL replace documentation and its existing capture-group examples. Add an example explaining curly-braced references when capture groups are adjacent to other text, and confirm the documentation clearly contrasts the ambiguous and disambiguated replacement strings.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100