Documentation ¶
Overview ¶
Package expr implements text matching.
Index ¶
- type Expr
- type ExprList
- type MatchRes
- type NamedExpr
- type SimpleExprBuilder
- func (s *SimpleExprBuilder) FromPattern(pattern string) Expr
- func (s *SimpleExprBuilder) FromPatternAndExclude(pattern string, exclude string) Expr
- func (s *SimpleExprBuilder) FromRegex(regex *regexp.Regexp) Expr
- func (s *SimpleExprBuilder) FromRegexAndExclude(regex *regexp.Regexp, excludeRegex *regexp.Regexp) Expr
- type SimpleExprList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExprList ¶
type ExprList interface { Expr Add(name string, expr Expr) GetName(no int) string Delete(name string) }
func NewSimpleExprList ¶
func NewSimpleExprListNamed ¶
type SimpleExprBuilder ¶ added in v1.0.26
type SimpleExprBuilder struct {
// contains filtered or unexported fields
}
func NewSimpleExpr ¶
func NewSimpleExpr() *SimpleExprBuilder
NewSimpleExpr returns builder that creates a simple expr that will process data as is
func NewSimpleExprFirst ¶
func NewSimpleExprFirst(first int) *SimpleExprBuilder
NewSimpleExprLast returns builder that creates a simple expr that will match only first n bytes of data
func NewSimpleExprFirst200 ¶
func NewSimpleExprFirst200() *SimpleExprBuilder
NewSimpleExprFirst200 is a wrapper around NewSimpleExprFirst with first fixed to 200
func NewSimpleExprLast ¶
func NewSimpleExprLast(last int) *SimpleExprBuilder
NewSimpleExprLast returns builder that creates a simple expr that will match only last n bytes of data
func NewSimpleExprLast20 ¶
func NewSimpleExprLast20() *SimpleExprBuilder
NewSimpleExprLast20 is a wrapper around NewSimpleExprLast with last fixed to 20
func NewSimpleExprLast200 ¶
func NewSimpleExprLast200() *SimpleExprBuilder
NewSimpleExprLast200 is a wrapper around NewSimpleExprLast with last fixed to 200
func (*SimpleExprBuilder) FromPattern ¶ added in v1.0.26
func (s *SimpleExprBuilder) FromPattern(pattern string) Expr
FromPattern creates a simple expr matcher from compiling given pattern. Panics in case of compilation failure, use your own regex with FromRegex if passed pattern can be incorrect.
func (*SimpleExprBuilder) FromPatternAndExclude ¶ added in v1.0.26
func (s *SimpleExprBuilder) FromPatternAndExclude(pattern string, exclude string) Expr
FromPatternAndExclude creates a simple expr matcher from compiling given match and exclude patterns. It will only match data that is matched by regex and is not matched by exclude regex. Panics in case of compilation failure, use your own regex with FromRegexAndExclude if passed patterns can be incorrect.
func (*SimpleExprBuilder) FromRegex ¶ added in v1.0.26
func (s *SimpleExprBuilder) FromRegex(regex *regexp.Regexp) Expr
FromRegex creates a simple expr matcher from given regex
func (*SimpleExprBuilder) FromRegexAndExclude ¶ added in v1.0.26
func (s *SimpleExprBuilder) FromRegexAndExclude(regex *regexp.Regexp, excludeRegex *regexp.Regexp) Expr
FromRegexAndExclude creates a simple expr matcher from passed regex and exclude. It will only match data that is matched by regex and is not matched by exclude regex.
type SimpleExprList ¶
type SimpleExprList struct {
// contains filtered or unexported fields
}
func (*SimpleExprList) Add ¶
func (m *SimpleExprList) Add(name string, expr Expr)
func (*SimpleExprList) Delete ¶
func (m *SimpleExprList) Delete(name string)
func (*SimpleExprList) GetName ¶
func (m *SimpleExprList) GetName(index int) string
func (SimpleExprList) Repr ¶
func (m SimpleExprList) Repr() string
func (SimpleExprList) String ¶
func (m SimpleExprList) String() string