Documentation
¶
Overview ¶
Package pm provides Lua pattern matching functions for Go.
Index ¶
Constants ¶
View Source
const MaxBacktracks = 100000
MaxBacktracks limits backtracking to prevent ReDoS attacks.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchData ¶
type MatchData struct {
// contains filtered or unexported fields
}
MatchData holds captured positions from a match. Layout: bit 0 indicates position capture, bits 1+ hold the position value.
func Find ¶
Find searches for pattern matches in src starting at offset. Returns up to limit matches (-1 for unlimited).
func (*MatchData) CaptureLength ¶
CaptureLength returns the number of capture slots.
func (*MatchData) IsPosCapture ¶
IsPosCapture returns true if the capture at idx is a position capture.
Click to show internal directories.
Click to hide internal directories.