regex

package
v1.8.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Regex

type Regex interface {
	FindStringSubmatch(s string) []string
	MatchString(s string) bool
	String() string
}

Regex interface to use regexp.Regexp and regexp2.Regexp interchangeably.

func Compile

func Compile(s string) (Regex, error)

Compile compiles via standard regexp package. Upon failure, it will also attempt compilation via regexp2 package.

func MustCompile

func MustCompile(s string) Regex

MustCompile compiles via standard regexp package. Upon failure, it will also attempt compilation via regexp2 package. Will panic, if both compilation attempts failed.

Jump to

Keyboard shortcuts

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