stringsearch

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaseFinder

type CaseFinder Finder

CaseFinder is a Finder that ignores case for ASCII letters (but not for letters with multibyte UTF-8 encodings).

func NewCaseFinder

func NewCaseFinder(pattern string) *CaseFinder

func (*CaseFinder) Next

func (f *CaseFinder) Next(text string) int

Next returns the index in text of the first occurrence of the pattern. If the pattern is not found, it returns -1.

type FieldNameFinder

type FieldNameFinder struct {
	// contains filtered or unexported fields
}

func NewFieldNameFinder

func NewFieldNameFinder(pattern string) *FieldNameFinder

func (*FieldNameFinder) Find

func (f *FieldNameFinder) Find(zctx *zed.Context, buf []byte) bool

Find returns true if buf, which holds a sequence of ZNG value messages, might contain a record with a field whose fully-qualified name (e.g., a.b.c) matches the pattern. find also returns true if it encounters an error.

type FieldNameIter

type FieldNameIter struct {
	// contains filtered or unexported fields
}

func (*FieldNameIter) Done

func (f *FieldNameIter) Done() bool

func (*FieldNameIter) Init

func (f *FieldNameIter) Init(t *zed.TypeRecord)

func (*FieldNameIter) Next

func (f *FieldNameIter) Next() []byte

type Finder

type Finder struct {
	// contains filtered or unexported fields
}

Finder efficiently finds strings in a source text. It's implemented using the Boyer-Moore string search algorithm: https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm https://www.cs.utexas.edu/~moore/publications/fstrpos.pdf (note: this aged document uses 1-based indexing)

func NewFinder

func NewFinder(pattern string) *Finder

func (*Finder) Next

func (f *Finder) Next(text string) int

Next returns the index in text of the first occurrence of the pattern. If the pattern is not found, it returns -1.

Jump to

Keyboard shortcuts

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