capre

package
v0.1.4713 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package capre is a regular expression held to a length.

Go's regexp unrolls a bounded repeat: [A-Za-z0-9.-]{0,254} is 254 copies of the class, 89kB of program kept from start to exit for one settings check. The same class with * is a few states, and the bound is a length check. A pattern here is whole-string (^…$), every character of it of the repeated classes, so the length is its count of characters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Regexp

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

func MustCompile

func MustCompile(expr string, max int) *Regexp

MustCompile is expr, unbounded, matching only a string of max characters at most.

func (*Regexp) MatchString

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

MatchString is whether s, of max characters at most, matches.

Jump to

Keyboard shortcuts

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