oniguruma

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateReplacementString

func ValidateReplacementString(replacement string) error

func Version

func Version() string

Types

type Regex

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

func Compile

func Compile(pattern string) (*Regex, error)

func (*Regex) Free

func (regex *Regex) Free()

func (*Regex) Gsub

func (regex *Regex) Gsub(input, replacement string) (string, error)

Returns a copy of input with the all occurrences of regex substituted with replacement. Replacement may contain numeric capture group references \1 and named capture group references \k<name>. Syntax is like Ruby's String.gsub(), see https://ruby-doc.org/core-2.1.4/String.html#method-i-gsub

func (*Regex) HasCaptureGroup

func (regex *Regex) HasCaptureGroup(name string) bool

func (*Regex) Search

func (regex *Regex) Search(input string) (*SearchResult, error)

type SearchResult

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

func (*SearchResult) Free

func (m *SearchResult) Free()

func (*SearchResult) GetCaptureGroupByName

func (m *SearchResult) GetCaptureGroupByName(name string) (string, error)

func (*SearchResult) GetCaptureGroupByNumber

func (m *SearchResult) GetCaptureGroupByNumber(groupNum int) (string, error)

func (*SearchResult) IsMatch

func (m *SearchResult) IsMatch() bool

Jump to

Keyboard shortcuts

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