stringsearch

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 1 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 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