regexp_utils

package
v1.4.3-alpha0806 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegexpMode1 regexpMode = "re1"
	RegexpMode2 regexpMode = "re2"
)
View Source
var DefaultYakRegexpManager = NewYakRegexpManager()

Functions

func RegexpAppendOption

func RegexpAppendOption(raw string, option regexp2.RegexOptions) string

Types

type RegWrapperInterface

type RegWrapperInterface interface {
	Match(b []byte) (bool, error)
	MatchString(s string) (bool, error)

	Find(b []byte) ([]byte, error)
	FindString(s string) (string, error)

	FindAll(b []byte) ([][]byte, error)
	FindAllString(s string) ([]string, error)

	FindSubmatch(b []byte) ([][]byte, error)
	FindStringSubmatch(s string) ([]string, error)

	FindAllSubmatchIndex(s string) ([][]int, error)

	ReplaceAll(src, repl []byte) ([]byte, error)
	ReplaceAllString(src, repl string) (string, error)

	ReplaceAllFunc(src []byte, repl func([]byte) []byte) ([]byte, error)
	ReplaceAllStringFunc(src string, repl func(string) string) (string, error)

	CanUse() bool
	String() string
}

type Regexp2Wrapper

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

func NewRegexp2Wrapper

func NewRegexp2Wrapper(raw string, options regexp2.RegexOptions) *Regexp2Wrapper

func (*Regexp2Wrapper) CanUse

func (r *Regexp2Wrapper) CanUse() bool

func (*Regexp2Wrapper) Find

func (r *Regexp2Wrapper) Find(b []byte) ([]byte, error)

func (*Regexp2Wrapper) FindAll

func (r *Regexp2Wrapper) FindAll(b []byte) ([][]byte, error)

func (*Regexp2Wrapper) FindAllString

func (r *Regexp2Wrapper) FindAllString(s string) ([]string, error)

func (*Regexp2Wrapper) FindAllSubmatchIndex

func (r *Regexp2Wrapper) FindAllSubmatchIndex(s string) ([][]int, error)

func (*Regexp2Wrapper) FindString

func (r *Regexp2Wrapper) FindString(s string) (string, error)

func (*Regexp2Wrapper) FindStringSubmatch

func (r *Regexp2Wrapper) FindStringSubmatch(s string) ([]string, error)

func (*Regexp2Wrapper) FindSubmatch

func (r *Regexp2Wrapper) FindSubmatch(b []byte) ([][]byte, error)

func (*Regexp2Wrapper) Match

func (r *Regexp2Wrapper) Match(b []byte) (bool, error)

func (*Regexp2Wrapper) MatchString

func (r *Regexp2Wrapper) MatchString(s string) (bool, error)

func (*Regexp2Wrapper) ReplaceAll

func (r *Regexp2Wrapper) ReplaceAll(src, repl []byte) ([]byte, error)

func (*Regexp2Wrapper) ReplaceAllFunc

func (r *Regexp2Wrapper) ReplaceAllFunc(src []byte, repl func([]byte) []byte) ([]byte, error)

func (*Regexp2Wrapper) ReplaceAllString

func (r *Regexp2Wrapper) ReplaceAllString(src, repl string) (string, error)

func (*Regexp2Wrapper) ReplaceAllStringFunc

func (r *Regexp2Wrapper) ReplaceAllStringFunc(src string, repl func(string) string) (string, error)

func (*Regexp2Wrapper) String

func (r *Regexp2Wrapper) String() string

type RegexpWrapper

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

func NewRegexpWrapper

func NewRegexpWrapper(raw string) *RegexpWrapper

func (*RegexpWrapper) CanUse

func (r *RegexpWrapper) CanUse() bool

func (*RegexpWrapper) Find

func (r *RegexpWrapper) Find(b []byte) ([]byte, error)

func (*RegexpWrapper) FindAll

func (r *RegexpWrapper) FindAll(b []byte) ([][]byte, error)

func (*RegexpWrapper) FindAllString

func (r *RegexpWrapper) FindAllString(s string) ([]string, error)

func (*RegexpWrapper) FindAllSubmatchIndex

func (r *RegexpWrapper) FindAllSubmatchIndex(s string) ([][]int, error)

func (*RegexpWrapper) FindString

func (r *RegexpWrapper) FindString(s string) (string, error)

func (*RegexpWrapper) FindStringSubmatch

func (r *RegexpWrapper) FindStringSubmatch(s string) ([]string, error)

func (*RegexpWrapper) FindSubmatch

func (r *RegexpWrapper) FindSubmatch(b []byte) ([][]byte, error)

func (*RegexpWrapper) Match

func (r *RegexpWrapper) Match(b []byte) (bool, error)

func (*RegexpWrapper) MatchString

func (r *RegexpWrapper) MatchString(s string) (bool, error)

func (*RegexpWrapper) ReplaceAll

func (r *RegexpWrapper) ReplaceAll(src, repl []byte) ([]byte, error)

func (*RegexpWrapper) ReplaceAllFunc

func (r *RegexpWrapper) ReplaceAllFunc(src []byte, repl func([]byte) []byte) ([]byte, error)

func (*RegexpWrapper) ReplaceAllString

func (r *RegexpWrapper) ReplaceAllString(src, repl string) (string, error)

func (*RegexpWrapper) ReplaceAllStringFunc

func (r *RegexpWrapper) ReplaceAllStringFunc(src string, repl func(string) string) (string, error)

func (*RegexpWrapper) String

func (r *RegexpWrapper) String() string

type YakRegexpManager

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

func NewYakRegexpManager

func NewYakRegexpManager() *YakRegexpManager

func (*YakRegexpManager) GetYakRegexp

func (manager *YakRegexpManager) GetYakRegexp(raw string, options ...YakRegexpUtilsOption) *YakRegexpUtils

type YakRegexpUtils

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

func NewYakRegexpUtils

func NewYakRegexpUtils(raw string, options ...YakRegexpUtilsOption) *YakRegexpUtils

func (*YakRegexpUtils) CanUse

func (m *YakRegexpUtils) CanUse() bool

func (*YakRegexpUtils) Find

func (m *YakRegexpUtils) Find(b []byte) ([]byte, error)

func (*YakRegexpUtils) FindAll

func (m *YakRegexpUtils) FindAll(b []byte) ([][]byte, error)

func (*YakRegexpUtils) FindAllString

func (m *YakRegexpUtils) FindAllString(s string) ([]string, error)

func (*YakRegexpUtils) FindAllSubmatchIndex

func (m *YakRegexpUtils) FindAllSubmatchIndex(s string) ([][]int, error)

func (*YakRegexpUtils) FindString

func (m *YakRegexpUtils) FindString(s string) (string, error)

func (*YakRegexpUtils) FindStringSubmatch

func (m *YakRegexpUtils) FindStringSubmatch(s string) ([]string, error)

func (*YakRegexpUtils) FindSubmatch

func (m *YakRegexpUtils) FindSubmatch(b []byte) ([][]byte, error)

func (*YakRegexpUtils) Hash

func (m *YakRegexpUtils) Hash() string

func (*YakRegexpUtils) Match

func (m *YakRegexpUtils) Match(b []byte) (bool, error)

func (*YakRegexpUtils) MatchString

func (m *YakRegexpUtils) MatchString(s string) (bool, error)

func (*YakRegexpUtils) ReplaceAll

func (m *YakRegexpUtils) ReplaceAll(src, repl []byte) ([]byte, error)

func (*YakRegexpUtils) ReplaceAllFunc

func (m *YakRegexpUtils) ReplaceAllFunc(src []byte, repl func([]byte) []byte) ([]byte, error)

func (*YakRegexpUtils) ReplaceAllString

func (m *YakRegexpUtils) ReplaceAllString(src, repl string) (string, error)

func (*YakRegexpUtils) ReplaceAllStringFunc

func (m *YakRegexpUtils) ReplaceAllStringFunc(src string, repl func(string) string) (string, error)

func (*YakRegexpUtils) SetPriority

func (m *YakRegexpUtils) SetPriority(mode regexpMode)

func (*YakRegexpUtils) String

func (m *YakRegexpUtils) String() string

type YakRegexpUtilsOption

type YakRegexpUtilsOption func(*YakRegexpUtils)

func WithPriorityMode

func WithPriorityMode(mode regexpMode) YakRegexpUtilsOption

func WithRegexpOption

func WithRegexpOption(option regexp2.RegexOptions) YakRegexpUtilsOption

Jump to

Keyboard shortcuts

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