Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dlclark/regexp2
/ functions
Functions
1,370 in github.com/dlclark/regexp2
⨍
Functions
1,370
◇
Types & classes
96
↓ 343 callers
Function
MustCompile
MustCompile is like Compile but panics if the expression cannot be parsed. It simplifies safe initialization of global variables holding compiled regu
regexp.go:154
↓ 144 callers
Method
MatchString
(s string)
compat/interface.go:15
↓ 128 callers
Method
FindStringMatch
FindStringMatch searches the input string for a Regexp match
regexp.go:259
↓ 114 callers
Method
String
String returns the captured text. For string input it is a slice of the original haystack: it does not allocate and keeps the original string alive.
match.go:78
↓ 54 callers
Function
Compile
Compile parses a regular expression and returns, if successful, a Regexp object that can be used to match against text.
regexp.go:79
↓ 44 callers
Method
Contains
Contains reports whether ch is in the character set, including negation and subtraction. It is equivalent to CharIn but avoids copying the set on each
syntax/charclass.go:323
↓ 39 callers
Method
Replace
Replace searches the input string and replaces each match found with the replacement text. Count will limit the number of matches attempted and startA
regexp.go:217
↓ 33 callers
Method
FindNextMatch
FindNextMatch returns the next match in the same input string as the match parameter. Will return nil if there is no next match or if given a nil matc
regexp.go:446
↓ 29 callers
Method
FindAllStringIndex
(s string, n int)
compat/interface.go:32
↓ 27 callers
Method
MatchRunes
MatchRunes return true if the runes matches the regex error will be set if a timeout occurs
regexp.go:523
↓ 27 callers
Method
Split
Split splits the given input string using the pattern and returns a slice of the parts. Count limits the number of matches to process. If Count is -1,
split.go:19
↓ 26 callers
Method
GroupByNumber
GroupByNumber returns a group based on the number of the group, or nil if the group number does not exist
match.go:416
↓ 25 callers
Method
Groups
Groups returns all the capture groups, starting with group 0 (the full match)
match.go:443
↓ 25 callers
Function
benchmark
(b *testing.B, re string, n int)
regexp_performance_test.go:330
↓ 23 callers
Method
charsRight
Number of characters to the right of the current parsing position.
syntax/parser.go:2548
↓ 21 callers
Method
ByteRange
()
regexp_test.go:438
↓ 20 callers
Method
FindRunesMatch
FindRunesMatch searches the input rune slice for a Regexp match
regexp.go:271
↓ 20 callers
Method
GroupByName
GroupByName returns a group based on the name of the group, or nil if the group name does not exist For duplicate ECMAScript names, it selects the par
match.go:396
↓ 20 callers
Function
Parse
Parse converts a regex string into a parse tree
syntax/parser.go:169
↓ 20 callers
Method
getErr
(code ErrorCode, args ...interface{})
syntax/parser.go:210
↓ 18 callers
Method
addChild
(child *RegexNode)
syntax/tree.go:262
↓ 18 callers
Method
rightChar
Returns the char i chars right of the current parsing position.
syntax/parser.go:2542
↓ 18 callers
Method
useOptionE
True if E option enabling ECMAScript behavior on.
syntax/parser.go:2609
↓ 17 callers
Method
moveRight
Moves the current position to the right.
syntax/parser.go:2526
↓ 16 callers
Function
RegisterEngine
(pattern string, engine RuntimeEngineData, options ...CompileOption)
regexp_codegen.go:33
↓ 16 callers
Method
RightToLeft
()
regexp.go:205
↓ 16 callers
Method
moveRightGetChar
Returns the char at the right of the current parsing position and advances to the right.
syntax/parser.go:2519
↓ 16 callers
Function
newRegexNode
(t NodeType, opt RegexOptions)
syntax/tree.go:139
↓ 14 callers
Method
Error
()
syntax/parser.go:59
↓ 14 callers
Method
String
()
syntax/prefix.go:591
↓ 14 callers
Method
canonicalize
Logic to reduce a character class to a unique, sorted form.
syntax/charclass.go:925
↓ 13 callers
Method
Capture
Capture captures a subexpression. Note that the capnum used here has already been mapped to a non-sparse index (by the code generator RegexWriter).
runner.go:2389
↓ 13 callers
Method
IsNegated
()
syntax/charclass.go:557
↓ 13 callers
Method
scan
scan starts at candidate while preserving textstart for \G. Both are rune indexes in rt. A nil textInfo defers rune input metadata until a match is re
runner.go:128
↓ 13 callers
Method
textpos
Returns the current parsing position.
syntax/parser.go:2509
↓ 11 callers
Method
FindAllRunesIndex
FindAllRunesIndex returns a slice of rune index pairs identifying all successive matches in r.
regexp.go:354
↓ 11 callers
Method
FindStringMatchStartingAt
FindStringMatchStartingAt searches the input string for a Regexp match starting at the startAt index
regexp.go:276
↓ 11 callers
Method
getRunner
getRunner returns a runner to use for matching re.
runner.go:2592
↓ 11 callers
Method
putRunner
putRunner returns a runner to the re's pool cache.
runner.go:2600
↓ 11 callers
Method
release
()
decode.go:166
↓ 10 callers
Method
Dump
()
syntax/code.go:358
↓ 10 callers
Method
GroupNumberFromName
GroupNumberFromName returns a group number that corresponds to a group name. Returns -1 if the name is not a recognized group name. Numbered groups au
regexp.go:619
↓ 10 callers
Function
IsWordChar
According to UTS#18 Unicode Regular Expressions (http://www.unicode.org/reports/tr18/) RL 1.4 Simple Word Boundaries The class of <word_character> in
syntax/charclass.go:473
↓ 10 callers
Method
Len
()
syntax/charclass.go:920
↓ 10 callers
Function
OptionMaxCachedReplacerDataEntries
OptionMaxCachedReplacerDataEntries limits parsed replacement patterns cached per Regexp.
options.go:131
↓ 10 callers
Method
ReplaceFunc
ReplaceFunc searches the input string and replaces each match found using the string from the evaluator Count will limit the number of matches attempt
regexp.go:254
↓ 9 callers
Method
Equals
(c2 *CharSet)
syntax/charclass.go:1394
↓ 9 callers
Method
FindRunesMatches
FindRunesMatches calls yield for each successive match in input, starting at the rune index startAt. A negative startAt starts at the beginning of inp
matchview.go:67
↓ 9 callers
Method
GroupCount
GroupCount returns the number of groups this match has matched
match.go:389
↓ 9 callers
Function
IndexStringIgnoreCaseASCII
(s, prefix string)
helpers/indexof.go:260
↓ 9 callers
Function
max
(x, y int)
syntax/prefixanalyzer.go:427
↓ 9 callers
Function
must
(err error)
compat/regexp.go:371
↓ 9 callers
Function
skipIfAllocsUnreliable
(t *testing.T)
regexp_pool_test.go:12
↓ 8 callers
Method
CharIn
CharIn returns true if the rune is in our character set (either ranges or categories). It handles negations and subtracted sub-charsets.
syntax/charclass.go:316
↓ 8 callers
Method
Copy
Copy makes a deep copy to prevent accidental mutation of a set
syntax/charclass.go:189
↓ 8 callers
Method
GetGroupNames
GetGroupNames returns the capture-group names in group-number order. Duplicate ECMAScript names appear once for each group with that name.
regexp.go:533
↓ 8 callers
Method
GroupRange
GroupRange returns the rune index and rune length of the last capture of the group with the given number. Indexes are relative to the original input,
matchview.go:31
↓ 8 callers
Method
addChar
(ch rune)
syntax/charclass.go:585
↓ 8 callers
Function
decodeInput
decodeInput converts s[decodeFrom:] to runes for internal scans, which do not need original-string offsets. Keep decoding in this call: an extra helpe
decode.go:106
↓ 8 callers
Function
hasMinRequiredBytes
(input string, startAt, minRequiredLength int)
stringprefixfilter.go:466
↓ 8 callers
Function
min
(x, y int)
syntax/prefixanalyzer.go:420
↓ 8 callers
Method
moveLeft
Moves the current parsing position one to the left.
syntax/parser.go:2532
↓ 8 callers
Function
newRegexNodeCh
(t NodeType, opt RegexOptions, ch rune)
syntax/tree.go:146
↓ 8 callers
Method
runeSliceIndex
()
match.go:99
↓ 8 callers
Function
sameStringIndexes
(a, b [][]int)
regexp_optimization_test.go:572
↓ 8 callers
Method
useOptionU
True if U option enabling ECMAScript's Unicode behavior on.
syntax/parser.go:2619
↓ 7 callers
Method
GetSetChars
Gets all of the characters in the specified set, storing them into the provided span. Only considers character classes that only contain sets (no cat
syntax/charclass.go:1344
↓ 7 callers
Function
IndexOf
(in []rune, find []rune)
helpers/indexof.go:334
↓ 7 callers
Function
IndexOfAny1
(in []rune, find rune)
helpers/indexof.go:46
↓ 7 callers
Function
OptionMaxCachedReplacerDataBytes
OptionMaxCachedReplacerDataBytes skips caching replacement patterns longer than n bytes.
options.go:138
↓ 7 callers
Method
decodeFrom
decodeFrom is the first original-string byte that must be decoded. 0 means the whole string; a later index is only used when slicing is safe.
decode.go:24
↓ 7 callers
Function
hasRequiredLengthAt
(r *Runner, start int)
runner.go:2295
↓ 7 callers
Method
read
Should change to atomic.Int64 when we can use go 1.19
fastclock.go:143
↓ 7 callers
Function
stringIndexPrefixFilter
(prefix string, ignoreCase bool, minRequiredLength int)
stringprefixfilter.go:176
↓ 7 callers
Method
textto
Zaps to a specific parsing position.
syntax/parser.go:2514
↓ 7 callers
Method
write
(v fasttime)
fastclock.go:144
↓ 6 callers
Function
DecodeString
DecodeString writes the runes of s into buf, which must have length >= len(s). It returns the rune count and whether s was all ASCII.
helpers/ascii.go:59
↓ 6 callers
Method
FindRunesMatchStartingAt
FindRunesMatchStartingAt searches the input rune slice for a Regexp match starting at the startAt index
regexp.go:308
↓ 6 callers
Method
GetGroupNumbers
GetGroupNumbers returns the integer group numbers corresponding to a group name.
regexp.go:551
↓ 6 callers
Method
Hash
()
syntax/charclass.go:1388
↓ 6 callers
Function
NewAsciiSearchValues
(vals string)
helpers/searchvalues.go:16
↓ 6 callers
Function
NewCharSetRuntime
(buf string)
syntax/charclass.go:273
↓ 6 callers
Method
Runes
Runes returns the captured text as a rune slice
match.go:91
↓ 6 callers
Method
String
()
syntax/optimizations.go:181
↓ 6 callers
Function
Write
(tree *RegexTree)
syntax/writer.go:10
↓ 6 callers
Method
addRanges
Merges new ranges to our own
syntax/charclass.go:669
↓ 6 callers
Function
assertByteRange
(t *testing.T, name string, c byteRanger, wantIndex, wantLength int)
regexp_test.go:441
↓ 6 callers
Function
compileEqualASCIIPrefixSearch
(prefixes []string)
prefixsearch.go:16
↓ 6 callers
Function
compileWithoutSearchOptimizations
Retain the traditional anchor, Boyer-Moore, and first-character search as a reference for the analyzed search strategies. Disable analysis on both pro
regexp_search_test.go:73
↓ 6 callers
Function
corpusIntSlicesEqual
(a, b []int)
regexp_corpus_helpers_test.go:58
↓ 6 callers
Function
durationToTicks
(d time.Duration)
fastclock.go:114
↓ 6 callers
Method
ensureStack
(plus int)
runner.go:1095
↓ 6 callers
Method
find
find returns the first core that starts in [startAt, limit). It reads past limit only to finish a core that starts before limit, and reads no rune at
runner.go:1955
↓ 6 callers
Method
findStringMatch
(s string)
compat/regexp.go:275
↓ 6 callers
Method
findStringMatchStart
(input string, startAt int)
stringprefixfilter.go:446
↓ 6 callers
Method
get
(key string)
regexp.go:736
↓ 6 callers
Function
latestPossibleStart
(r *Runner)
runner.go:2284
↓ 6 callers
Method
poolIndex
(neededSize, maxSize int)
bufferpool.go:23
↓ 6 callers
Function
stringSlicesEqual
(a, b []string)
regexp_captureorder_test.go:95
↓ 6 callers
Function
unwrapTransparentNodes
(node *RegexNode)
syntax/prefixanalyzer.go:1332
next →
1–100 of 1,370, ranked by callers