MCPcopy Create free account

hub / github.com/dlclark/regexp2 / functions

Functions1,368 in github.com/dlclark/regexp2

↓ 342 callersFunctionMustCompile
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
↓ 143 callersMethodMatchString
(s string)
compat/interface.go:15
↓ 128 callersMethodFindStringMatch
FindStringMatch searches the input string for a Regexp match
regexp.go:259
↓ 114 callersMethodString
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 callersFunctionCompile
Compile parses a regular expression and returns, if successful, a Regexp object that can be used to match against text.
regexp.go:79
↓ 43 callersMethodContains
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 callersMethodReplace
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 callersMethodFindNextMatch
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 callersMethodFindAllStringIndex
(s string, n int)
compat/interface.go:32
↓ 27 callersMethodMatchRunes
MatchRunes return true if the runes matches the regex error will be set if a timeout occurs
regexp.go:523
↓ 27 callersMethodSplit
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 callersMethodGroupByNumber
GroupByNumber returns a group based on the number of the group, or nil if the group number does not exist
match.go:416
↓ 25 callersMethodGroups
Groups returns all the capture groups, starting with group 0 (the full match)
match.go:443
↓ 25 callersFunctionbenchmark
(b *testing.B, re string, n int)
regexp_performance_test.go:330
↓ 23 callersMethodcharsRight
Number of characters to the right of the current parsing position.
syntax/parser.go:2548
↓ 21 callersMethodByteRange
()
regexp_test.go:438
↓ 20 callersMethodFindRunesMatch
FindRunesMatch searches the input rune slice for a Regexp match
regexp.go:271
↓ 20 callersMethodGroupByName
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 callersMethodgetErr
(code ErrorCode, args ...interface{})
syntax/parser.go:210
↓ 19 callersFunctionParse
Parse converts a regex string into a parse tree
syntax/parser.go:169
↓ 18 callersMethodaddChild
(child *RegexNode)
syntax/tree.go:262
↓ 18 callersMethodrightChar
Returns the char i chars right of the current parsing position.
syntax/parser.go:2542
↓ 18 callersMethoduseOptionE
True if E option enabling ECMAScript behavior on.
syntax/parser.go:2609
↓ 17 callersMethodmoveRight
Moves the current position to the right.
syntax/parser.go:2526
↓ 16 callersFunctionRegisterEngine
(pattern string, engine RuntimeEngineData, options ...CompileOption)
regexp_codegen.go:33
↓ 16 callersMethodRightToLeft
()
regexp.go:205
↓ 16 callersMethodmoveRightGetChar
Returns the char at the right of the current parsing position and advances to the right.
syntax/parser.go:2519
↓ 16 callersFunctionnewRegexNode
(t NodeType, opt RegexOptions)
syntax/tree.go:139
↓ 14 callersMethodError
()
syntax/parser.go:59
↓ 14 callersMethodString
()
syntax/prefix.go:591
↓ 14 callersMethodcanonicalize
Logic to reduce a character class to a unique, sorted form.
syntax/charclass.go:943
↓ 13 callersMethodCapture
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 callersMethodIsNegated
()
syntax/charclass.go:572
↓ 13 callersMethodscan
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 callersMethodtextpos
Returns the current parsing position.
syntax/parser.go:2509
↓ 11 callersMethodFindAllRunesIndex
FindAllRunesIndex returns a slice of rune index pairs identifying all successive matches in r.
regexp.go:354
↓ 11 callersMethodFindStringMatchStartingAt
FindStringMatchStartingAt searches the input string for a Regexp match starting at the startAt index
regexp.go:276
↓ 11 callersMethodgetRunner
getRunner returns a runner to use for matching re.
runner.go:2592
↓ 11 callersMethodputRunner
putRunner returns a runner to the re's pool cache.
runner.go:2600
↓ 11 callersMethodrelease
()
decode.go:166
↓ 10 callersMethodDump
()
syntax/code.go:358
↓ 10 callersMethodGroupNumberFromName
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 callersFunctionIsWordChar
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:488
↓ 10 callersMethodLen
()
syntax/charclass.go:938
↓ 10 callersFunctionOptionMaxCachedReplacerDataEntries
OptionMaxCachedReplacerDataEntries limits parsed replacement patterns cached per Regexp.
options.go:131
↓ 10 callersMethodReplaceFunc
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 callersMethodEquals
(c2 *CharSet)
syntax/charclass.go:1412
↓ 9 callersMethodFindRunesMatches
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 callersMethodGroupCount
GroupCount returns the number of groups this match has matched
match.go:389
↓ 9 callersFunctionIndexStringIgnoreCaseASCII
(s, prefix string)
helpers/indexof.go:260
↓ 9 callersFunctionmax
(x, y int)
syntax/prefixanalyzer.go:427
↓ 9 callersFunctionmust
(err error)
compat/regexp.go:371
↓ 9 callersFunctionskipIfAllocsUnreliable
(t *testing.T)
regexp_pool_test.go:12
↓ 8 callersMethodCharIn
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 callersMethodCopy
Copy makes a deep copy to prevent accidental mutation of a set
syntax/charclass.go:189
↓ 8 callersMethodGetGroupNames
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 callersMethodGroupRange
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 callersMethodaddChar
(ch rune)
syntax/charclass.go:600
↓ 8 callersFunctiondecodeInput
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 callersFunctionhasMinRequiredBytes
(input string, startAt, minRequiredLength int)
stringprefixfilter.go:466
↓ 8 callersFunctionmin
(x, y int)
syntax/prefixanalyzer.go:420
↓ 8 callersMethodmoveLeft
Moves the current parsing position one to the left.
syntax/parser.go:2532
↓ 8 callersFunctionnewRegexNodeCh
(t NodeType, opt RegexOptions, ch rune)
syntax/tree.go:146
↓ 8 callersMethodruneSliceIndex
()
match.go:99
↓ 8 callersFunctionsameStringIndexes
(a, b [][]int)
regexp_optimization_test.go:572
↓ 8 callersMethoduseOptionU
True if U option enabling ECMAScript's Unicode behavior on.
syntax/parser.go:2619
↓ 7 callersMethodGetSetChars
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:1362
↓ 7 callersFunctionIndexOf
(in []rune, find []rune)
helpers/indexof.go:334
↓ 7 callersFunctionIndexOfAny1
(in []rune, find rune)
helpers/indexof.go:46
↓ 7 callersFunctionOptionMaxCachedReplacerDataBytes
OptionMaxCachedReplacerDataBytes skips caching replacement patterns longer than n bytes.
options.go:138
↓ 7 callersMethoddecodeFrom
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 callersFunctionhasRequiredLengthAt
(r *Runner, start int)
runner.go:2295
↓ 7 callersMethodread
Should change to atomic.Int64 when we can use go 1.19
fastclock.go:143
↓ 7 callersFunctionstringIndexPrefixFilter
(prefix string, ignoreCase bool, minRequiredLength int)
stringprefixfilter.go:176
↓ 7 callersMethodtextto
Zaps to a specific parsing position.
syntax/parser.go:2514
↓ 7 callersMethodwrite
(v fasttime)
fastclock.go:144
↓ 6 callersFunctionDecodeString
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 callersMethodFindRunesMatchStartingAt
FindRunesMatchStartingAt searches the input rune slice for a Regexp match starting at the startAt index
regexp.go:308
↓ 6 callersMethodGetGroupNumbers
GetGroupNumbers returns the integer group numbers corresponding to a group name.
regexp.go:551
↓ 6 callersFunctionNewAsciiSearchValues
(vals string)
helpers/searchvalues.go:16
↓ 6 callersMethodRunes
Runes returns the captured text as a rune slice
match.go:91
↓ 6 callersMethodString
()
syntax/optimizations.go:181
↓ 6 callersMethodaddRanges
Merges new ranges to our own
syntax/charclass.go:684
↓ 6 callersFunctionassertByteRange
(t *testing.T, name string, c byteRanger, wantIndex, wantLength int)
regexp_test.go:441
↓ 6 callersFunctioncompileEqualASCIIPrefixSearch
(prefixes []string)
prefixsearch.go:16
↓ 6 callersFunctioncompileWithoutSearchOptimizations
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 callersFunctioncorpusIntSlicesEqual
(a, b []int)
regexp_corpus_helpers_test.go:58
↓ 6 callersFunctiondurationToTicks
(d time.Duration)
fastclock.go:114
↓ 6 callersMethodensureStack
(plus int)
runner.go:1095
↓ 6 callersMethodfind
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 callersMethodfindStringMatch
(s string)
compat/regexp.go:275
↓ 6 callersMethodfindStringMatchStart
(input string, startAt int)
stringprefixfilter.go:446
↓ 6 callersMethodget
(key string)
regexp.go:736
↓ 6 callersFunctionlatestPossibleStart
(r *Runner)
runner.go:2284
↓ 6 callersMethodpoolIndex
(neededSize, maxSize int)
bufferpool.go:23
↓ 6 callersFunctionstringSlicesEqual
(a, b []string)
regexp_captureorder_test.go:95
↓ 6 callersFunctionunwrapTransparentNodes
(node *RegexNode)
syntax/prefixanalyzer.go:1332
↓ 6 callersMethoduseRE2
true to use RE2 compatibility parsing behavior.
syntax/parser.go:2614
↓ 5 callersMethodHash
()
syntax/charclass.go:1406
↓ 5 callersMethodIndexOfAny
return the first index of our original vals values within the slice given
helpers/searchvalues.go:34
next →1–100 of 1,368, ranked by callers