Categorygithub.com/lovego/regex_tree
modulepackage
0.0.1
Repository: https://github.com/lovego/regex_tree.git
Documentation: pkg.go.dev

# README

regex_tree

a regular expression prefix tree.

Build Status Coverage Status Go Report Card Documentation

Usage

package main

import (
	"fmt"
	"github.com/lovego/regex_tree"
)

func main() {
	root, err := regex_tree.New("/", 1)
	if err != nil {
		fmt.Println(err)
		return
	}
	root.Add("/users", 2)
	root.Add(`/users/(\d+)`, 3)

	fmt.Println(root.Lookup("/"))
	fmt.Println(root.Lookup("/users"))
	fmt.Println(root.Lookup("/users/1013"))
	fmt.Println(root.Lookup("/users/a013"))

	// Output:
	// 1 []
	// 2 []
	// 3 [1013]
	// <nil> []
}

# Functions

No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author