util

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllNonGreedy

func AllNonGreedy(regs ...*syntax.Regexp)

AllNonGreedy turns greedy quantifiers such as `.*` and `.+` into non-greedy ones. This is the same effect as writing `.*?` and `.+?`. This is only safe because we use `Match`. If we were to find the exact position and length of the match we would not be allowed to make this optimization. `Match` can return quicker because it is not looking for the longest match. Prepending the expression with `(?U)` or passing `NonGreedy` to the expression compiler is not enough since it will just negate `.*` and `.*?`.

func ClearCapture

func ClearCapture(regs ...*syntax.Regexp)

ClearCapture removes capture operation as they are not used for filtering.

func IsCaseInsensitive

func IsCaseInsensitive(reg *syntax.Regexp) bool

func SplitFiltersAndMatchers

func SplitFiltersAndMatchers(allMatchers []*labels.Matcher) (filters, matchers []*labels.Matcher)

SplitFiltersAndMatchers splits empty matchers off, which are treated as filters, see #220

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL