MCPcopy Index your code
hub / github.com/yuin/gopher-lua / capturedString

Function capturedString

stringlib.go:190–201  ·  view source on GitHub ↗
(L *LState, m *pm.MatchData, str string, idx int)

Source from the content-addressed store, hash-verified

188}
189
190func capturedString(L *LState, m *pm.MatchData, str string, idx int) string {
191 checkCaptureIndex(L, m, idx)
192 if idx >= m.CaptureLength() && idx == 2 {
193 idx = 0
194 }
195 if m.IsPosCapture(idx) {
196 return fmt.Sprint(m.Capture(idx))
197 } else {
198 return str[m.Capture(idx):m.Capture(idx+1)]
199 }
200
201}
202
203func strGsubDoReplace(str string, info []replaceInfo) string {
204 offset := 0

Callers 2

strGsubStrFunction · 0.85
strGsubFuncFunction · 0.85

Calls 4

checkCaptureIndexFunction · 0.85
CaptureLengthMethod · 0.80
IsPosCaptureMethod · 0.80
CaptureMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…