ladon: Index | Files

package compiler

import ""


Package Files


func CompileRegex Uses

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 ...

Package compiler imports 5 packages (graph) and is imported by 13 packages. Updated 2020-01-25. Refresh now. Tools for package owners.