regex

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BaseImport = `[A-Za-z](\/?[A-Z-a-z0-9._-])*`
	Import     = `((` + BaseImport + `)|("` + BaseImport + `")|"\.")`
	GoToken    = `[A-Za-z][A-Za-z0-9_]*`
	YamlToken  = `[A-Za-z]((\.|-|_)?[A-Za-z0-9])*`
	GoFunc     = `((?P<import>` + Import + `)\.)?(?P<fn>` + GoToken + `)`

	MetaPkg                  = GoToken
	MetaContainerType        = GoToken
	MetaContainerConstructor = GoToken
	MetaImport               = Import
	MetaImportAlias          = YamlToken
	MetaFn                   = GoToken
	MetaGoFn                 = GoFunc

	ParamName = YamlToken

	ServiceName   = YamlToken
	ServiceGetter = GoToken
	ServiceType   = `(?P<ptr>\*)?` + `((?P<import>` + Import + `)\.)?(?P<type>` + GoToken + `)`
	// ServiceValue supports
	// Value
	// &Value
	// my/import.Value
	// "my/import".GlobalVar.Field
	// &"my/import".GlobalVar.Field
	// MyStruct{}
	// &MyStruct{}
	// my/import.MyStruct{}
	// &my/import.MyStruct{}
	ServiceValue = `((?P<v1>(?P<ptr>\&)?((?P<import>` + Import + `)\.)?(?P<value>` + GoToken + `(\.` + GoToken + `)*` + `))` +
		`|(?P<v2>(?P<ptr2>\&)?((?P<import2>` + Import + `)\.)?(?P<struct2>` + GoToken + `)\{\}))`
	ServiceConstructor = GoFunc
	ServiceCallName    = GoToken
	ServiceFieldName   = GoToken
	ServiceTag         = YamlToken

	PrefixService = `@`
	ArgService    = PrefixService + "(?P<service>" + YamlToken + ")"
	PrefixTagged  = `!tagged\s+`
	ArgTagged     = PrefixTagged + "(?P<tag>" + YamlToken + ")"
	PrefixValue   = `!value\s+`
	ArgValue      = PrefixValue + "((?P<argval>" + ServiceValue + "))"

	DecoratorTag    = `(\*|(` + ServiceTag + `))`
	DecoratorMethod = GoFunc
)

Variables

This section is empty.

Functions

func Match

func Match(r *regexp.Regexp, s string) (bool, map[string]string)

func MustCompileAz

func MustCompileAz(r string) *regexp.Regexp

MustCompileAz wraps input by `\A(` and `)\z` and compiles into regexp.Regexp struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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