regexps

package
v0.0.0-...-8c81104 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package regexps defines a global cache for regular expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(pattern string) (*regexp2.Regexp, error)

Get compiles pattern (if not already cached) using the global store and returns the result.

Types

type RegexpStore

type RegexpStore struct {
	// contains filtered or unexported fields
}

RegexpStore is a thread-safe cache that compiles and stores regexp2 patterns on first use.

func (*RegexpStore) Get

func (ps *RegexpStore) Get(pattern string) (*regexp2.Regexp, error)

Get returns the compiled regexp for pattern, compiling and caching it on the first call.

Jump to

Keyboard shortcuts

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