Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileError ¶
type CompileError struct {
// contains filtered or unexported fields
}
CompileError returned on regex compilation error
func (*CompileError) Error ¶
func (c *CompileError) Error() string
type NoMatchFoundError ¶
type NoMatchFoundError struct{}
NoMatchFoundError indicates no regex matches for given string
func (*NoMatchFoundError) Error ¶
func (n *NoMatchFoundError) Error() string
type NotStructPtrError ¶
type NotStructPtrError struct{}
NotStructPtrError returned when given target is not a truct pointer
func (*NotStructPtrError) Error ¶
func (n *NotStructPtrError) Error() string
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError returned when the conversion to target struct field type has failed
func (*ParseError) Error ¶
func (p *ParseError) Error() string
type ReGroup ¶
type ReGroup struct {
// contains filtered or unexported fields
}
ReGroup is the main ReGroup matcher struct
func Compile ¶
Compile compiles given expression as regex and return new ReGroup with this expression as matching engine. If the expression can't be compiled as regex, a CompileError will be returned
func MustCompile ¶
MustCompile calls Compile and panics if it returns an error
func (*ReGroup) Groups ¶
Groups returns a map contains each group name as a key and the group's matched value as value
func (*ReGroup) MatchAllToTarget ¶
MatchAllToTarget will find all the regex matches for given string 's', and parse them into objects of the same type as `targetType` argument. The return type is an array of interfaces, which every element is the same type as `targetType` argument. If no matches found, a &NoMatchFoundError error will be returned
func (*ReGroup) MatchToTarget ¶
MatchToTarget matches a regex expression to string s and parse it into `target` argument. If no matches found, a &NoMatchFoundError error will be returned
type RequiredGroupIsEmpty ¶
type RequiredGroupIsEmpty struct {
// contains filtered or unexported fields
}
RequiredGroupIsEmpty returned when a required group is empty in the re match
func (*RequiredGroupIsEmpty) Error ¶
func (r *RequiredGroupIsEmpty) Error() string
type TypeNotParsableError ¶
type TypeNotParsableError struct {
// contains filtered or unexported fields
}
TypeNotParsableError returned when the type of struct field is not parsable
func (*TypeNotParsableError) Error ¶
func (t *TypeNotParsableError) Error() string
type UnknownGroupError ¶
type UnknownGroupError struct {
// contains filtered or unexported fields
}
UnknownGroupError returned when given regex group tag isn't exists in compiled regex groups
func (*UnknownGroupError) Error ¶
func (u *UnknownGroupError) Error() string