Skip to content
Discussion options

You must be logged in to vote

Parse regex used https://docs.rs/regex/latest/regex/struct.Regex.html#method.capture_names internally and without a name, it will not use the result. If you passed numeric_groups: true, you would see

{ "0": "service-manager.log" }

Here's how it works: playground

.file = parse_regex!(.file, r'.*/(?P<name>[^/]+)$').name
.other = parse_regex!(.file, r'[^/]*$', true)."0"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by harikeshtripathi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
vrl: stdlib Changes to the standard library
2 participants