Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dlclark/regexp2
/ functions
Functions
1,368 in github.com/dlclark/regexp2
⨍
Functions
1,368
◇
Types & classes
96
↓ 3 callers
Function
findFirstCharClass
Computes a character class for the first character in tree. This uses a more robust algorithm than is used by TryFindFixedLiterals and thus can find
syntax/prefixanalyzer.go:19
↓ 3 callers
Function
findPrefix
Computes the leading substring in node may be empty.
syntax/prefixanalyzer.go:240
↓ 3 callers
Method
findStringPrefixCandidate
(input string, startAt int)
stringprefixfilter.go:432
↓ 3 callers
Function
foldASCII
(c rune)
helpers/indexof.go:327
↓ 3 callers
Method
forEachStringMatch
(s string, n int, f func(*regexp2.Match))
compat/regexp.go:287
↓ 3 callers
Function
getPooledReplaceBuffer
(neededBytes, maxSize int)
bufferpool.go:111
↓ 3 callers
Function
graphemeClass
(ch rune)
syntax/grapheme.go:246
↓ 3 callers
Function
hasECMAWordCharExtras
(options RegexOptions)
syntax/charclass.go:519
↓ 3 callers
Function
heapAlloc
()
regexp_pool_test.go:702
↓ 3 callers
Function
indexAnyPrefixFallback
(input string, startAt int, prefixes []string, ignoreCase bool, minRequiredLength int)
stringprefixfilter.go:223
↓ 3 callers
Method
indexRunes
indexRunes returns an absolute rune index, or -1. A non-ASCII rune (including invalid rune values accepted by rune APIs) cannot occur in these prefixe
prefixsearch.go:86
↓ 3 callers
Method
initCaches
()
regexp.go:702
↓ 3 callers
Function
isStringRuneBoundary
(s string, index int)
stringprefixfilter.go:473
↓ 3 callers
Function
lookupUnicodeCategory
lookupUnicodeCategory searches the source tables without building a merged map at startup. Preserve the old map's overwrite precedence: generated prop
syntax/charclass.go:99
↓ 3 callers
Method
makeLoopAtomic
()
syntax/tree.go:809
↓ 3 callers
Method
makeRep
Pass type as OneLazy or OneLoop
syntax/tree.go:293
↓ 3 callers
Function
makeText
(n int)
regexp_performance_test.go:309
↓ 3 callers
Method
namedReference
ECMAScript 2025 §22.2.2.7.2 BackreferenceMatcher selects the sole defined capture among the named slots (step 1.6) and consumes nothing if none is def
syntax/parser.go:267
↓ 3 callers
Function
newRegexNodeMN
(t NodeType, opt RegexOptions, m, n int)
syntax/tree.go:177
↓ 3 callers
Function
newRegexNodeSet
(t NodeType, opt RegexOptions, set *CharSet)
syntax/tree.go:162
↓ 3 callers
Function
newRegexNodeStr
(t NodeType, opt RegexOptions, str []rune)
syntax/tree.go:154
↓ 3 callers
Method
noteCaptureSlot
(i, pos int)
syntax/parser.go:214
↓ 3 callers
Method
reached
reached returns true if current time is at or past t.
fastclock.go:41
↓ 3 callers
Function
readRunes
(r io.RuneReader)
compat/regexp.go:355
↓ 3 callers
Method
reduce
()
syntax/tree.go:474
↓ 3 callers
Method
run
run starts a search on rune input. mode selects bounds-only, borrowed-capture, or independently owned results. textstart is -1 to start at the "begin
runner.go:105
↓ 3 callers
Method
scanCharEscape
Scans \ code for escape codes that map to single unicode chars.
syntax/parser.go:2247
↓ 3 callers
Method
setOperator
(op int)
runner.go:1284
↓ 3 callers
Method
setPattern
(pattern string)
syntax/parser.go:201
↓ 3 callers
Method
shouldUseRunes
Retain the existing first-character scanners when candidates are sparse. Sampling is bounded, and short inputs retain their cheaper existing search.
prefixsearch.go:54
↓ 3 callers
Method
shouldUseString
(input string, startAt int)
prefixsearch.go:67
↓ 3 callers
Function
stringFixedDistanceCandidateStart
(input string, startAt, byteIndex, distance int)
stringprefixfilter.go:417
↓ 3 callers
Function
stringFixedDistanceCharFilter
(ch rune, distance, minRequiredLength int)
stringprefixfilter.go:320
↓ 3 callers
Function
stringFixedDistanceStringFilter
(literal string, distance, minRequiredLength int)
stringprefixfilter.go:353
↓ 3 callers
Method
useOptionX
True if X option enabling whitespace/comment mode is on.
syntax/parser.go:2604
↓ 2 callers
Method
CheckTimeout
()
runner.go:2577
↓ 2 callers
Method
Crawlpos
Get the height of the stack
runner.go:1127
↓ 2 callers
Function
Escape
Escape adds backslashes to any special characters in the input string
regexp.go:171
↓ 2 callers
Method
Find
(b []byte)
compat/interface.go:18
↓ 2 callers
Method
FindAll
(b []byte, n int)
compat/interface.go:29
↓ 2 callers
Method
FindAllSubmatchIndex
(b []byte, n int)
compat/interface.go:36
↓ 2 callers
Method
FindIndex
(b []byte)
compat/interface.go:19
↓ 2 callers
Method
FindLastExpressionInLoopForAutoAtomic
Recurs into the last expression of a loop node, looking to see if it can find a node that could be made atomic _assuming_ the conditions exist for it
syntax/tree.go:940
↓ 2 callers
Method
FindReaderSubmatchIndex
(r io.RuneReader)
compat/interface.go:21
↓ 2 callers
Method
FindString
(s string)
compat/interface.go:22
↓ 2 callers
Method
FindSubmatch
(b []byte)
compat/interface.go:26
↓ 2 callers
Method
FindSubmatchIndex
(b []byte)
compat/interface.go:27
↓ 2 callers
Method
GetIfNRanges
(n int)
syntax/charclass.go:1535
↓ 2 callers
Method
IndexOfAny
(in []rune)
helpers/searchvalues.go:184
↓ 2 callers
Function
IndexOfAny2
(in []rune, find1, find2 rune)
helpers/indexof.go:53
↓ 2 callers
Function
IndexOfAny3
(in []rune, find1, find2, find3 rune)
helpers/indexof.go:63
↓ 2 callers
Function
IndexOfAnyExcept
(in []rune, bad []rune)
helpers/indexof.go:82
↓ 2 callers
Method
IsBoundary
decide whether the pos at the specified index is a boundary or not. It's just not worth emitting inline code for this logic.
runner.go:2529
↓ 2 callers
Method
IsECMABoundaryWithOptions
IsECMABoundaryWithOptions reports whether index is an ECMAScript word boundary for a \b or \B with the given options: whether exactly one of the chara
runner.go:2554
↓ 2 callers
Function
IsECMALineTerminator
IsECMALineTerminator reports whether r is an ECMAScript LineTerminator: LF, CR, LINE SEPARATOR or PARAGRAPH SEPARATOR.
syntax/charclass.go:525
↓ 2 callers
Function
IsECMAWordCharWithOptions
IsECMAWordCharWithOptions reports whether r is in the ECMAScript WordCharacters that \w, \b and \B are defined by, for a \b or \B with the given optio
syntax/charclass.go:514
↓ 2 callers
Function
NewReplacerDataWithGroupNumbers
NewReplacerDataWithGroupNumbers is like NewReplacerData, with ECMAScript duplicate names mapped to their public group numbers in declaration order. Th
syntax/replacerdata.go:58
↓ 2 callers
Function
NewStringSearchValues
(vals [][]rune, ignoreCase bool)
helpers/searchvalues.go:142
↓ 2 callers
Method
OpcodeDescription
OpcodeDescription is a humman readable string of the specific offset
syntax/code.go:279
↓ 2 callers
Function
OptionDebug
OptionDebug enables debug output and runner tracing for the compiled regexp.
options.go:159
↓ 2 callers
Function
OptionDisableCharClassASCIIBitmap
OptionDisableCharClassASCIIBitmap disables compile-time ASCII bitmaps for character classes.
options.go:145
↓ 2 callers
Function
OptionMaxCachedReplaceBufferLength
OptionMaxCachedReplaceBufferLength limits retained replacement output buffers in the shared size-classed pool.
options.go:124
↓ 2 callers
Method
PrepareCharSetASCIIBitmaps
PrepareCharSetASCIIBitmaps builds bounded ASCII lookup tables for compiled character classes before the regexp is shared across goroutines.
syntax/code.go:187
↓ 2 callers
Function
SetTimeoutCheckPeriod
SetTimeoutPeriod is a debug function that sets the frequency of the timeout goroutine's sleep cycle. Defaults to 100ms. The only benefit of setting th
regexp.go:183
↓ 2 callers
Function
StartsWithIgnoreCase
StartsWithIgnoreCaseAscii would be faster find should always be sent in lower-case
helpers/indexof.go:418
↓ 2 callers
Method
String
String returns the source text used to compile the regular expression.
regexp.go:194
↓ 2 callers
Method
String
()
syntax/parser.go:114
↓ 2 callers
Method
addCharCategory
(ct charCategory)
syntax/charclass.go:663
↓ 2 callers
Method
addConcatenate
Finish the current quantifiable (when a quantifier is not found or is not possible)
syntax/parser.go:2629
↓ 2 callers
Function
addMaxLength
(x, y int)
syntax/tree.go:1564
↓ 2 callers
Method
addProperty
(cc *CharSet, property string, negate, ignoreCase bool)
syntax/ecma_unicode.go:100
↓ 2 callers
Method
addSpace
(ecma, re2, negate bool)
syntax/charclass.go:604
↓ 2 callers
Method
addSubtraction
(sub *CharSet)
syntax/charclass.go:880
↓ 2 callers
Method
addToConcatenate
Add a string to the last concatenate.
syntax/parser.go:2748
↓ 2 callers
Method
addUnitNode
Sets the current unit to a subtree
syntax/parser.go:2703
↓ 2 callers
Method
addWord
(ecma, negate bool)
syntax/charclass.go:622
↓ 2 callers
Function
assertCorpusOptimizedEquivalent
(t *testing.T, pattern string, options []CompileOption, input string)
regexp_corpus_helpers_test.go:32
↓ 2 callers
Function
assertSameMatchResult
(t *testing.T, api, input string, got *Match, gotErr error, want *Match, wantErr error)
regexp_optimization_test.go:536
↓ 2 callers
Method
balanceMatch
Nonpublic builder: Add a capture to balance the specified group. This is used by the balanced match construct. (?<foo-foo2>...) If there were no s
match.go:359
↓ 2 callers
Function
cacheKeyFromConfig
(pattern string, c compileConfig)
regexp_codegen.go:76
↓ 2 callers
Method
canBeMadeAtomic
Determines whether a node can be switched to an atomic loop. The node following is subsequent, used to determine whether it overlaps. iterateNullable
syntax/tree.go:983
↓ 2 callers
Function
canonicalUnicodeCatName
(catName string)
syntax/charclass.go:729
↓ 2 callers
Method
captureSlotFromName
Looks up the slot number for a given name
syntax/parser.go:2557
↓ 2 callers
Method
charAt
Returns the char left of the current parsing position.
syntax/parser.go:2537
↓ 2 callers
Method
charInCategories
(ch rune)
syntax/charclass.go:398
↓ 2 callers
Function
charInFixedDistanceSet
(set syntax.FixedDistanceSet, ch rune)
runner.go:2263
↓ 2 callers
Function
checkEqualASCIIPrefixSearch
(t *testing.T, prefixes []string, input []rune)
prefixsearch_test.go:93
↓ 2 callers
Function
compile
(expr string, c compileConfig)
regexp.go:84
↓ 2 callers
Function
compileASCIIStringSetPrefixFilter
compileASCIIStringSetPrefixFilter builds a byte-oriented multi-prefix scanner for the narrow shape where it beats running strings.Index once per prefi
stringprefixfilter.go:258
↓ 2 callers
Function
compileFindFirstChar
compileFindFirstChar preserves the precedence of the interpreter's search strategies: fixed trailing anchors, leading anchors, Boyer-Moore, analyzed s
findfirstchar.go:11
↓ 2 callers
Method
containsAsciiIgnoreCaseCharacter
Gets whether the set description string is for two ASCII letters that case to each other under IgnoreCase rules.
syntax/charclass.go:1477
↓ 2 callers
Function
containsTestOpcode
(re *Regexp, want syntax.InstOp)
regexp_syntax_extensions_test.go:247
↓ 2 callers
Function
corpusFindStringSubmatchIndex
(t *testing.T, re *Regexp, input string)
regexp_corpus_helpers_test.go:5
↓ 2 callers
Function
countTestOpcode
(re *Regexp, want syntax.InstOp)
regexp_syntax_extensions_test.go:251
↓ 2 callers
Method
curPos
Returns the current position in the emitted code.
syntax/writer.go:572
↓ 2 callers
Method
decodeLeftContextRunes
()
decode.go:38
↓ 2 callers
Method
disjointStartingSets
disjointStartingSets returns the non-nullable first-character set for each branch when all of those sets are pairwise disjoint.
syntax/tree.go:716
↓ 2 callers
Function
ecmaLegacyCase
Legacy ECMAScript /i compares single UTF-16-unit uppercase mappings, not Unicode simple folds. Non-ASCII characters must never map to ASCII. https://t
syntax/charclass.go:847
↓ 2 callers
Function
ecmaPropertySet
map[string]func() *CharSet
syntax/ecma_unicode.go:20
↓ 2 callers
Function
ecmaRangesFromTable
Expand strided Go tables lazily into the shared property cache; their full contents aren't embedded again in the package's generated Unicode data.
syntax/ecma_unicode.go:198
← previous
next →
201–300 of 1,368, ranked by callers