Open h0cheung opened 3 months ago
Pinging code owners:
pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
See Adding Labels via Comments if you do not have permissions to add labels yourself.
I think it would likely make sense to offer a more powerful alternative regex engine for cases like this where the built-in Go engine isn't sufficient. We could probably add an engine
or lang
optional parameter to our functions to allow selecting what is used.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
The standard
regexp
in Go is sometimes powerless, which make us hard to do some replacement.For example, I want to replaces pure number path segment in a http url. I tried to use some expression:
/\d+(/|$)
to/?$1
.However, if there are continuous segments, they won't be replaced at once:
/12/34/56/78
->/?/34/?/78
. As positive lookahead is not supported, the only workaround I find this to replace by this expression again, but it will cause 2x cpu usage.(/\d+){1,}(/$)
can match perfectly, but I can't find a way to replace each match of(/\d+)
to/?
.Describe the solution you'd like
{x,}
Describe alternatives you've considered
No response
Additional context
No response