modulepackage
0.0.0-20240518133315-a468a5bfb3bc
Repository: https://github.com/grafana/regexp.git
Documentation: pkg.go.dev
# README
Grafana Go regexp package
This repo is a fork of the upstream Go regexp
package, with some code optimisations to make it run faster.
All the optimisations have been submitted upstream, but not yet merged.
All semantics are the same, and the optimised code passes all tests from upstream.
The main
branch is non-optimised: switch over to speedup
branch for the improved code.
Benchmarks:
# Packages
Package syntax parses regular expressions into parse trees and compiles
parse trees into programs.
# Functions
Compile parses a regular expression and returns, if successful, a [Regexp] object that can be used to match against text.
CompilePOSIX is like [Compile] but restricts the regular expression to POSIX ERE (egrep) syntax and changes the match semantics to leftmost-longest.
Match reports whether the byte slice b contains any match of the regular expression pattern.
MatchReader reports whether the text returned by the RuneReader contains any match of the regular expression pattern.
MatchString reports whether the string s contains any match of the regular expression pattern.
MustCompile is like [Compile] but panics if the expression cannot be parsed.
MustCompilePOSIX is like [CompilePOSIX] but panics if the expression cannot be parsed.
QuoteMeta returns a string that escapes all regular expression metacharacters inside the argument text; the returned string is a regular expression matching the literal text.