Documentation ¶
Index ¶
- func LiteralRep(rep string) (string, bool)
- func Replacement(s, rep string, cap *Captures) string
- type BitSet
- type Captures
- type Pattern
- func (pat Pattern) All(s string) iter.Seq[*Captures]
- func (pat Pattern) FirstMatch(s string, i int, cap *Captures) bool
- func (pat Pattern) LastMatch(s string, i int, cap *Captures) bool
- func (pat Pattern) Literal() (string, bool)
- func (pat Pattern) Match(s string, cap *Captures) bool
- func (pat Pattern) Matches(s string) bool
- func (pat Pattern) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LiteralRep ¶
LiteralRep returns (string,true) if rep is literal, otherwise it returns ("",false)
func Replacement ¶
Replacement makes a single replacement, handling case conversion, &, and \#
Types ¶
type BitSet ¶
type BitSet struct {
// contains filtered or unexported fields
}
BitSet is a set of int16 stored in bits. Zero value is ready to use. Memory usages depends on the maximum integer value so it should only be used for small values.
type Pattern ¶
type Pattern string
func (Pattern) FirstMatch ¶
FirstMatch finds the first match at or after position i
func (Pattern) LastMatch ¶
LastMatch finds the last match in s. It is less efficient, but rarely used.
func (Pattern) Match ¶
Match looks for a match anywhere in the string i.e. not anchored. It returns true if a match was found, and false otherwise. If it returns true, the captures are updated.
Click to show internal directories.
Click to hide internal directories.