func RegisterPattern(name string, pattern string) error {
	return defaultPatternStore.Register(name, pattern)
}
RegisterPattern allow you add a customize pattern to the defaultPatternStore.
package trie
import (
	"fmt"
	"regexp"
	"strings"
)
const (
	DefaultPatternDelimeter = ":"
)
var triePattern = regexp.MustCompile(`<(?P<pattern>\w+?:*[\w|\*]+?)>`)
func init() {
	defaultPatternStore.Register("str", `\w+`)
	defaultPatternStore.Register("int", `\d+`)
	defaultPatternStore.Register("*", `.+`)
	defaultPatternStore.DefaultPattern = func() string {
		return `(\w+)`
	}
}
type PatternStore struct {
	Patterns       map[string]string
	DefaultPattern func() string
}
func NewPatternStore() *PatternStore {
	return &PatternStore{
		Patterns: make(map[string]string),
	}
}
func (store *PatternStore) Register(name string, pattern string) error {
	if _, ok := store.Patterns[name]; ok {
		return ErrDuplicatedPatternName
	}
	store.Patterns[name] = fmt.Sprintf(`(%s)`, pattern)
	return nil
}
func (store *PatternStore) GetPattern(name string) string {
	if pattern, ok := store.Patterns[name]; ok {
		return pattern
	}
	return store.DefaultPattern()
}
var defaultPatternStore = NewPatternStore()