compiler

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 44

README

compiler

Read the docs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileRegex

func CompileRegex(tpl string, delimiterStart, delimiterEnd byte) (*regexp2.Regexp, error)

CompileRegex parses a template and returns a Regexp.

You can define your own delimiters. It is e.g. common to use curly braces {} but I recommend using characters which have no special meaning in Regex, e.g.: <, >

reg, err := compiler.CompileRegex("foo:bar.baz:<[0-9]{2,10}>", '<', '>')
// if err != nil ...
reg.MatchString("foo:bar.baz:123")

Types

This section is empty.

Jump to

Keyboard shortcuts

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