regexp

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 14 Imported by: 0

README

= go-regexp-re: Pure Go Byte-Oriented DFA Regex Engine
:linkattrs:

image:https://github.com/kamichidu/go-regexp-re/actions/workflows/ci.yml/badge.svg?branch=main["CI / Quality Audit", link="https://github.com/kamichidu/go-regexp-re/actions/workflows/ci.yml"]
image:https://github.com/kamichidu/go-regexp-re/actions/workflows/benchmark.yml/badge.svg?branch=main["Benchmark Status", link="https://github.com/kamichidu/go-regexp-re/actions/workflows/benchmark.yml"]
image:https://goreportcard.com/badge/github.com/kamichidu/go-regexp-re["Go Report Card", link="https://goreportcard.com/report/github.com/kamichidu/go-regexp-re"]
image:https://pkg.go.dev/badge/github.com/kamichidu/go-regexp-re.svg["Go Reference", link="https://pkg.go.dev/github.com/kamichidu/go-regexp-re"]
image:https://img.shields.io/github/license/kamichidu/go-regexp-re["License", link="https://github.com/kamichidu/go-regexp-re/blob/main/LICENSE"]


[IMPORTANT]
====
This project is in **active development (Beta)**. Interfaces and internal architecture may evolve.
It is **NOT** a full replacement for the Go standard `regexp` package; it targets a deterministic subset optimized for strictly $O(n)$ execution.
====

go-regexp-re is a pure Go byte-oriented DFA regex engine. It is designed for extreme throughput and Core API Subset Compatibility for a deterministic feature subset.

== Core Value

This engine is optimized for:

- **Deterministic $O(n)$ regex execution** for supported pattern classes.
- **Zero-backtracking matching guarantees**, eliminating ReDoS vulnerabilities.
- **Compile-time optimized execution planning** to minimize runtime overhead.
- **High-throughput byte-level scanning** for long-lived regex workloads.

== Technical Characteristics

* **Pure Go (No CGO, No Assembly)**: Implementation is written entirely in native Go. Extreme performance is achieved through compiler-friendly loop structures and runtime-safe bitwise/SWAR-style operations expressed in Go, avoiding the portability and maintenance costs of CGO or assembly.
* **Byte-Oriented Scanning**: Input is processed as a raw byte sequence (`[]byte`) to avoid the overhead of UTF-8 rune decoding and maximize CPU pipeline efficiency.
* **Deterministic Finite Automaton (DFA)**: Patterns are converted into deterministic transition tables to ensure constant-time processing per input byte.
* **Execution Transparency**: Built-in introspection capabilities via `Regexp.Explain()` and the `regexp-re-explain` tool, providing detailed visibility into compilation decisions and execution plans.
* **API Subset Compatibility**: High-fidelity parity with the core interface of the standard `regexp` package for supported deterministic pattern classes. It guarantees 100% correctness for full match boundaries (indices 0 and 1). Submatch boundaries (indices 2+) are provided on a best-effort basis for ambiguous constructs.

== Core Architecture: Multi-Pass Sparse TDFA

The heart of `go-regexp-re` is its **Multi-Pass Sparse TDFA (Tagged Deterministic Finite Automaton)** pipeline. Unlike traditional backtracking engines or monolithic DFAs, this engine orchestrates multiple specialized passes to achieve both $O(n)$ time complexity and Go-native submatch precision.

=== The Multi-Pass Pipeline

The engine executes a series of coordinated passes, selecting the most efficient **Execution Kernels** for each stage:

1. **Pass 0: Discovery (MAP)**: Rapidly identifies match candidates using SIMD-style literal searching or bit-parallel SWAR kernels.
2. **Pass 1: Boundary Discovery**: Uses a specialized **Searching DFA** to determine the exact match end and winning priority with $O(1)$ memory per byte.
3. **Pass 2: Anchored Recording**: If submatches are required, an **Anchored DFA** re-scans the identified match range to record a compressed execution history.
4. **Pass 3 & 4: Extraction**: Reconstructs the winning NFA path and applies capture tags using bit-parallel updates.

=== Auxiliary Execution Kernels

While the Multi-Pass pipeline provides the framework, the actual scanning is performed by interchangeable kernels optimized for specific patterns:

* **Literal Bypass**: A zero-overhead kernel for constant strings that skips DFA construction entirely.
* **Specialized DFAs**: Multiple internal DFAs (Searching, Anchored, and sDFA pre-filters) are used as auxiliary engines within the pipeline stages.
* **SWAR/Bit-parallel Kernels**: Accelerators that fast-forward through character classes and repetitions at memory-bandwidth speeds.

== Usage

The default memory limit for DFA construction is **64MiB**. For patterns requiring larger state spaces, use `CompileWithOptions`.

[source,go]
----
import (
    regexp "github.com/kamichidu/go-regexp-re"
)

func main() {
    // Basic usage
    re := regexp.MustCompile(`[a-zA-Z_][a-zA-Z0-9_]*`)

    // Custom options (e.g., higher memory limit for complex patterns)
    reComplex, err := regexp.CompileWithOptions(`pattern`, regexp.CompileOptions{
        MaxMemory: 256 * 1024 * 1024,
    })
}
----

=== Best Practice: Long-lived Objects

Regex compilation in this engine is computationally expensive. To amortize the construction cost, it is recommended to compile patterns once and reuse the resulting objects.

[source,go]
----
var identRe = regexp.MustCompile(`[a-zA-Z_][a-zA-Z0-9_]*`)

func IsIdentifier(s string) bool {
    return identRe.MatchString(s)
}
----

== Execution Explanation

The `regexp-re-explain` tool provides transparency into the engine's compilation decisions and execution strategy. It is essential for debugging performance and understanding how a specific pattern is optimized.

=== Installation

[source,bash]
----
go install github.com/kamichidu/go-regexp-re/cmd/regexp-re-explain@latest
----

=== Execution

Pass any regular expression pattern as an argument, read from a file using the `-f` flag, or provide it via standard input (STDIN):

[source,bash]
----
# Standard usage
regexp-re-explain "(a+)b"

# From a file
regexp-re-explain -f pattern.txt

# From STDIN (useful for multi-line or complex escapes)
echo "(abc|def)" | regexp-re-explain

# With custom memory limit (e.g., 128 MiB) using units
regexp-re-explain -m 128m "(a+)b"

# Units supported: k (KiB), m (MiB), g (GiB)
regexp-re-explain -m 1g "very-complex-pattern"
----

=== Interpreting the Output

The output is organized into three logical layers:

1. **[IR - COMPILED STRUCTURE]**: Physical characteristics of the compiled object.
    * *Strategy*: High-level execution path (Literal, Fast, or Extended).
    * *MAP Strategy*: Pre-filter selection (SIMD vs SWAR vs sDFA). Refer to technical details on **xref:docs/algorithm/multi-point-anchored-constraint-propagation.adoc[MAP Optimization]**, **xref:docs/algorithm/searching-dfa.adoc[Searching DFA]**, and **xref:docs/algorithm/swar-character-class-warp.adoc[SWAR Kernels]**.
    * *DFA Resource Stats*: physical memory footprint and state count.
2. **[EXPLAIN - LOGICAL EXECUTION PLAN]**: The runtime execution pipeline.
    * *Tree View*: Hierarchical representation of the 5-pass pipeline (Pass 0 to Pass 4). Detailed mechanics are described in the **xref:docs/algorithm/multi-pass-sparse-tdfa.adoc[Multi-Pass TDFA documentation]**.
    * *Filters*: Specific Gaze (O(1) checks) and Snap (horizon discovery) conditions.
    * *Skip*: Intentionally bypassed phases with static reasoning provided.
3. **[ESTIMATED PERFORMANCE MODEL]**: Heuristic performance forecast.
    * *SBL Trends*: Selectivity (S) and Locality (L) binning (Low/Middle/High). For a detailed explanation of the SBL model, refer to the **xref:docs/benchmark-landscape.adoc[Performance Landscape documentation]**.
    * *Fitness Logic*: Matrix showing how S and L combine (e.g., S:Low * L:High => Optimal).

== Compatibility & Constraints

`go-regexp-re` provides high API compatibility with the Go standard `regexp` package while prioritizing $O(n)$ performance and DFA determinism. While the interface is a drop-in replacement, the underlying engine enforces specific structural constraints to maintain its performance guarantees.

For a comprehensive breakdown of our validation strategy and architectural boundaries, refer to the **xref:docs/compatibility-policy.adoc[Compatibility Policy]**.

=== Shared with Go Standard Library

Like the standard library (RE2-based), this engine enforces constraints necessary to guarantee linear-time execution:

1. **No Backreferences**: Features like `(a)\1` are strictly unsupported as they would require exponential-time backtracking.
2. **ASCII-Only Character Classes**: Common Perl character classes and boundaries are restricted to the ASCII range, matching standard Go behavior.
3. **Leftmost-First Rule**: We strictly follow Go's standard matching priority. POSIX "longest-match" semantics are not supported, as our priority is high-fidelity API compatibility with Go's default `regexp` behavior.

=== API Subset & Excluded Features

To maintain a focused, high-performance execution model, the following Go `regexp` features are excluded:

1. **Longest-match (POSIX) API**: Methods like `Longest()` are not implemented. The engine is strictly optimized for Go's default leftmost-first semantics.
2. **Backreferences & Lookaround**: Features requiring non-linear time or complex backtracking are inherently incompatible with our DFA architecture.

=== Engine-Specific Architectural Constraints

1. **Strict Structural Validation**: Certain patterns are rejected at compile-time with `regexp.UnsupportedError` to **preserve DFA determinacy** and guarantee $O(n)$ performance. Refer to the **xref:docs/compatibility-policy.adoc[Compatibility Policy]** for details and examples.
   - **Epsilon Loops**: e.g., `(|a)*`, `(a?)*`.
   - **Ambiguous Captures**: e.g., `(a|)`, `(a*)?`.
2. **Submatch Precision**: While overall match boundaries (indices 0 and 1) are strictly compliant, internal submatch boundaries for highly ambiguous patterns (e.g., `a*(a)`) may occasionally deviate.
3. **Byte-Level Matching**: The engine operates on raw bytes. While it correctly handles UTF-8 boundaries, it does not support `\uFFFD` replacement semantics for invalid UTF-8 sequences to maintain maximum throughput.

== Implementation Details

Refer to the internal documentation for details on the algorithms and stability guarantees:

* **xref:docs/api-stability.adoc[API Stability Policy]**
* **xref:docs/algorithm.adoc[Technical Documentation: Algorithms]**
* **xref:docs/compatibility-policy.adoc[Compatibility & Validation Policy]**
* **xref:docs/benchmark-strategy.adoc[Benchmark Strategy]**

== Testing & Benchmarking

The project maintains a rigorous multi-layered verification suite:

[source,bash]
----
# Unit tests & Modular verification
go test -v .

# Standard Library Parity Audit
go test -v ./internal/compat

# Performance Benchmarks (Normalized Ratios)
./_scripts/benchmark-full.sh
----

== Project Stability

While in Beta, `go-regexp-re` is continuously audited against the standard library's test suite and high-stress NFA-hard corpora to ensure functional integrity and $O(n)$ predictability within its deterministic subset.

== Roadmap

1. **Repetition Priority Resolution**: Continued alignment of greedy loop submatch boundaries with standard library behavior.
2. **Construction Phase Optimization**: Reduction of compilation time and memory footprint for complex patterns.
3. **Concurrent Scan Support**: Formal verification and benchmarking of concurrent execution across multiple goroutines.
4. **Postal Code Stress Test**: Validating scaling and performance with extremely large pattern sets (100,000+ literals).
5. **Fixed-length Assertions**: Implementation of efficient lookahead and lookbehind assertions within the DFA framework.
6. **Memory Efficiency**: Optimizing the DFA transition table storage for massive alternations to reduce memory pressure.


== Acknowledgments

`go-regexp-re` owes its core concept and inspiration to the legendary Perl module **`Regexp::Assemble`**.

Years ago, the profound elegance and power of `Regexp::Assemble` left a lasting impression on me. This project is an attempt to evolve that same spirit within the modern Go ecosystem, pushing the boundaries of DFA-based matching to its physical limits.

Documentation

Overview

Example
package main

import (
	"fmt"
	"strings"

	"github.com/kamichidu/go-regexp-re"
)

func main() {
	pattern := `a(b+)c`
	src := "abbc"
	repl := "X"

	// Package-level functions
	{
		matched, _ := regexp.Match(pattern, []byte(src))
		fmt.Printf("Match: %v\n", matched)

		matchedString, _ := regexp.MatchString(pattern, src)
		fmt.Printf("MatchString: %v\n", matchedString)

		matchedReader, _ := regexp.MatchReader(pattern, strings.NewReader(src))
		fmt.Printf("MatchReader: %v\n", matchedReader)

		re, _ := regexp.Compile(pattern)
		fmt.Printf("Compile: %v\n", re.String())

		reMust := regexp.MustCompile(pattern)
		fmt.Printf("MustCompile: %v\n", reMust.String())

		quoted := regexp.QuoteMeta(`[a-z]`)
		fmt.Printf("QuoteMeta: %s\n", quoted)
	}

	re := regexp.MustCompile(pattern)

	// Regexp methods
	{
		fmt.Printf("String: %s\n", re.String())
		fmt.Printf("NumSubexp: %d\n", re.NumSubexp())
		fmt.Printf("SubexpNames: %q\n", re.SubexpNames())
		fmt.Printf("SubexpIndex: %d\n", re.SubexpIndex("foo"))

		prefix, complete := re.LiteralPrefix()
		fmt.Printf("LiteralPrefix: %q, %v\n", prefix, complete)

		fmt.Printf("Match: %v\n", re.Match([]byte(src)))
		fmt.Printf("MatchString: %v\n", re.MatchString(src))
		fmt.Printf("MatchReader: %v\n", re.MatchReader(strings.NewReader(src)))

		fmt.Printf("Find: %q\n", re.Find([]byte(src)))
		fmt.Printf("FindIndex: %v\n", re.FindIndex([]byte(src)))
		fmt.Printf("FindString: %q\n", re.FindString(src))
		fmt.Printf("FindStringIndex: %v\n", re.FindStringIndex(src))
		fmt.Printf("FindReaderIndex: %v\n", re.FindReaderIndex(strings.NewReader(src)))

		fmt.Printf("FindSubmatch: %q\n", re.FindSubmatch([]byte(src)))
		fmt.Printf("FindSubmatchIndex: %v\n", re.FindSubmatchIndex([]byte(src)))
		fmt.Printf("FindStringSubmatch: %q\n", re.FindStringSubmatch(src))
		fmt.Printf("FindStringSubmatchIndex: %v\n", re.FindStringSubmatchIndex(src))
		fmt.Printf("FindReaderSubmatchIndex: %v\n", re.FindReaderSubmatchIndex(strings.NewReader(src)))

		fmt.Printf("FindAll: %q\n", re.FindAll([]byte(src), -1))
		fmt.Printf("FindAllIndex: %v\n", re.FindAllIndex([]byte(src), -1))
		fmt.Printf("FindAllString: %q\n", re.FindAllString(src, -1))
		fmt.Printf("FindAllStringIndex: %v\n", re.FindAllStringIndex(src, -1))

		fmt.Printf("FindAllSubmatch: %q\n", re.FindAllSubmatch([]byte(src), -1))
		fmt.Printf("FindAllSubmatchIndex: %v\n", re.FindAllSubmatchIndex([]byte(src), -1))
		fmt.Printf("FindAllStringSubmatch: %q\n", re.FindAllStringSubmatch(src, -1))
		fmt.Printf("FindAllStringSubmatchIndex: %v\n", re.FindAllStringSubmatchIndex(src, -1))

		fmt.Printf("ReplaceAll: %q\n", re.ReplaceAll([]byte(src), []byte(repl)))
		fmt.Printf("ReplaceAllString: %q\n", re.ReplaceAllString(src, repl))
		fmt.Printf("ReplaceAllLiteral: %q\n", re.ReplaceAllLiteral([]byte(src), []byte(repl)))
		fmt.Printf("ReplaceAllLiteralString: %q\n", re.ReplaceAllLiteralString(src, repl))
		fmt.Printf("ReplaceAllFunc: %q\n", re.ReplaceAllFunc([]byte(src), func(b []byte) []byte { return b }))
		fmt.Printf("ReplaceAllStringFunc: %q\n", re.ReplaceAllStringFunc(src, func(s string) string { return s }))

		fmt.Printf("Split: %q\n", re.Split(src, -1))

		marshaled, _ := re.MarshalText()
		fmt.Printf("MarshalText: %s\n", marshaled)

		var re2 regexp.Regexp
		_ = re2.UnmarshalText(marshaled)
		fmt.Printf("UnmarshalText: %s\n", re2.String())

		dst := []byte("Initial: ")
		template := "Captured: $1"
		match := re.FindSubmatchIndex([]byte(src))
		fmt.Printf("Expand: %q\n", re.Expand(dst, []byte(template), []byte(src), match))
		fmt.Printf("ExpandString: %q\n", re.ExpandString(dst, template, src, match))

		reCopy := re.Copy()
		fmt.Printf("Copy: %v\n", reCopy.String())
	}

	// Methods specifically known to be excluded from the "Core API Subset"
	// These will fail compilation if uncommented.
	{
		// re.Longest()
		// regexp.CompilePOSIX(pattern)
		// regexp.MustCompilePOSIX(pattern)
	}

}
Output:
Match: true
MatchString: true
MatchReader: true
Compile: a(b+)c
MustCompile: a(b+)c
QuoteMeta: \[a-z\]
String: a(b+)c
NumSubexp: 1
SubexpNames: ["" ""]
SubexpIndex: -1
LiteralPrefix: "a", false
Match: true
MatchString: true
MatchReader: true
Find: "abbc"
FindIndex: [0 4]
FindString: "abbc"
FindStringIndex: [0 4]
FindReaderIndex: [0 4]
FindSubmatch: ["abbc" "bb"]
FindSubmatchIndex: [0 4 1 3]
FindStringSubmatch: ["abbc" "bb"]
FindStringSubmatchIndex: [0 4 1 3]
FindReaderSubmatchIndex: [0 4 1 3]
FindAll: ["abbc"]
FindAllIndex: [[0 4]]
FindAllString: ["abbc"]
FindAllStringIndex: [[0 4]]
FindAllSubmatch: [["abbc" "bb"]]
FindAllSubmatchIndex: [[0 4 1 3]]
FindAllStringSubmatch: [["abbc" "bb"]]
FindAllStringSubmatchIndex: [[0 4 1 3]]
ReplaceAll: "X"
ReplaceAllString: "X"
ReplaceAllLiteral: "X"
ReplaceAllLiteralString: "X"
ReplaceAllFunc: "abbc"
ReplaceAllStringFunc: "abbc"
Split: ["" ""]
MarshalText: a(b+)c
UnmarshalText: a(b+)c
Expand: "Initial: Captured: bb"
ExpandString: "Initial: Captured: bb"
Copy: a(b+)c

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(pattern string, b []byte) (matched bool, err error)

func MatchReader deprecated

func MatchReader(pattern string, r io.RuneReader) (matched bool, err error)

MatchReader reports whether the regular expression pattern matches the text read by the RuneReader.

Deprecated: This function performs a full memory load of the reader's content before processing and is not truly streaming.

func MatchString

func MatchString(pattern string, s string) (matched bool, err error)

func QuoteMeta

func QuoteMeta(s string) string

Types

type CompileOptions

type CompileOptions struct {
	MaxMemory int
	// contains filtered or unexported fields
}

type ExplainOptions

type ExplainOptions struct {
	// MaxPatternLength defines the maximum number of characters to display for the pattern.
	// Use -1 for unlimited length. 0 defaults to 80.
	MaxPatternLength int
}

type Regexp

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

func Compile

func Compile(expr string) (*Regexp, error)

func CompileContext

func CompileContext(ctx context.Context, expr string) (*Regexp, error)

func CompileContextWithOptions

func CompileContextWithOptions(ctx context.Context, expr string, opts CompileOptions) (*Regexp, error)

func CompileWithOptions

func CompileWithOptions(expr string, opt CompileOptions) (*Regexp, error)

func MustCompile

func MustCompile(expr string) *Regexp

func (*Regexp) Copy

func (re *Regexp) Copy() *Regexp

func (*Regexp) Expand

func (re *Regexp) Expand(dst []byte, template []byte, src []byte, match []int) []byte

func (*Regexp) ExpandString

func (re *Regexp) ExpandString(dst []byte, template string, src string, match []int) []byte

func (*Regexp) Explain

func (re *Regexp) Explain() string

func (*Regexp) ExplainWithOptions

func (re *Regexp) ExplainWithOptions(opts ExplainOptions) string

func (*Regexp) Find

func (re *Regexp) Find(b []byte) []byte

func (*Regexp) FindAll

func (re *Regexp) FindAll(b []byte, n int) [][]byte

func (*Regexp) FindAllIndex

func (re *Regexp) FindAllIndex(b []byte, n int) [][]int

func (*Regexp) FindAllString

func (re *Regexp) FindAllString(s string, n int) []string

func (*Regexp) FindAllStringIndex

func (re *Regexp) FindAllStringIndex(s string, n int) [][]int

func (*Regexp) FindAllStringSubmatch

func (re *Regexp) FindAllStringSubmatch(s string, n int) [][]string

func (*Regexp) FindAllStringSubmatchIndex

func (re *Regexp) FindAllStringSubmatchIndex(s string, n int) [][]int

func (*Regexp) FindAllSubmatch

func (re *Regexp) FindAllSubmatch(b []byte, n int) [][][]byte

func (*Regexp) FindAllSubmatchIndex

func (re *Regexp) FindAllSubmatchIndex(b []byte, n int) [][]int

func (*Regexp) FindIndex

func (re *Regexp) FindIndex(b []byte) []int

func (*Regexp) FindReaderIndex deprecated

func (re *Regexp) FindReaderIndex(r io.RuneReader) (loc []int)

FindReaderIndex returns a two-element slice of integers defining the location of the leftmost match of the regular expression in text read from the RuneReader.

Deprecated: This method performs a full memory load of the reader's content before processing and is not truly streaming.

func (*Regexp) FindReaderSubmatchIndex deprecated

func (re *Regexp) FindReaderSubmatchIndex(r io.RuneReader) []int

FindReaderSubmatchIndex returns a slice holding the index pairs identifying the leftmost match of the regular expression of the text read from the RuneReader, and the matches, if any, of its capturing groups.

Deprecated: This method performs a full memory load of the reader's content before processing and is not truly streaming.

func (*Regexp) FindString

func (re *Regexp) FindString(s string) string

func (*Regexp) FindStringIndex

func (re *Regexp) FindStringIndex(s string) []int

func (*Regexp) FindStringSubmatch

func (re *Regexp) FindStringSubmatch(s string) []string

func (*Regexp) FindStringSubmatchIndex

func (re *Regexp) FindStringSubmatchIndex(s string) []int

func (*Regexp) FindSubmatch

func (re *Regexp) FindSubmatch(b []byte) [][]byte

func (*Regexp) FindSubmatchIndex

func (re *Regexp) FindSubmatchIndex(b []byte) []int

func (*Regexp) LiteralPrefix

func (re *Regexp) LiteralPrefix() (prefix string, complete bool)

func (*Regexp) MarshalText

func (re *Regexp) MarshalText() ([]byte, error)

func (*Regexp) Match

func (re *Regexp) Match(b []byte) bool

func (*Regexp) MatchReader deprecated

func (re *Regexp) MatchReader(r io.RuneReader) bool

MatchReader reports whether the regular expression matches the text read by the RuneReader.

Deprecated: This method performs a full memory load of the reader's content before processing and is not truly streaming.

func (*Regexp) MatchString

func (re *Regexp) MatchString(s string) bool

func (*Regexp) NumSubexp

func (re *Regexp) NumSubexp() int

func (*Regexp) ReplaceAll

func (re *Regexp) ReplaceAll(src, repl []byte) []byte

func (*Regexp) ReplaceAllFunc

func (re *Regexp) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte

func (*Regexp) ReplaceAllLiteral

func (re *Regexp) ReplaceAllLiteral(src, repl []byte) []byte

func (*Regexp) ReplaceAllLiteralString

func (re *Regexp) ReplaceAllLiteralString(src, repl string) string

func (*Regexp) ReplaceAllString

func (re *Regexp) ReplaceAllString(src, repl string) string

func (*Regexp) ReplaceAllStringFunc

func (re *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string

func (*Regexp) Split

func (re *Regexp) Split(s string, n int) []string

func (*Regexp) String

func (re *Regexp) String() string

func (*Regexp) SubexpIndex

func (re *Regexp) SubexpIndex(name string) int

func (*Regexp) SubexpNames

func (re *Regexp) SubexpNames() []string

func (*Regexp) UnmarshalText

func (re *Regexp) UnmarshalText(text []byte) error

type UnsupportedError

type UnsupportedError = syntax.UnsupportedError

UnsupportedError represents a regular expression pattern that is not supported by the current DFA-based engine.

Directories

Path Synopsis
cmd
internal
ir

Jump to

Keyboard shortcuts

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