Documentation
¶
Index ¶
- Variables
- func Create(regularExpressionPattern string) (*regexp.Regexp, error)
- func CreateApplicableLock(regularExpressionPattern string) (regEx *regexp.Regexp, err error, isApplicable bool)
- func CreateLock(regularExpressionPattern string) (*regexp.Regexp, error)
- func CreateLockIf(isLock bool, regularExpressionSyntax string) (*regexp.Regexp, error)
- func CreateMust(regularExpressionSyntax string) *regexp.Regexp
- func CreateMustLockIf(isLock bool, regularExpressionSyntax string) *regexp.Regexp
- func IsMatchFailed(regex, comparing string) bool
- func IsMatchLock(regex, comparing string) bool
- func MatchError(regex, comparing string) error
- func MatchErrorLock(regex, comparing string) error
- func MatchUsingCustomizeErrorFuncLock(regexPattern, comparing string, matchFunc RegexValidationFunc, ...) error
- func MatchUsingFuncErrorLock(regexPattern, comparing string, matchFunc RegexValidationFunc) error
- func NewMustLock(regularExpressionSyntax string) *regexp.Regexp
- type CustomizeErr
- type LazyRegex
- func (it *LazyRegex) Compile() (regex *regexp.Regexp, err error)
- func (it *LazyRegex) CompileMust() (regex *regexp.Regexp)
- func (it *LazyRegex) CompiledError() error
- func (it *LazyRegex) Error() error
- func (it *LazyRegex) FirstMatchLine(content string) (firstMatch string, isInvalidMatch bool)
- func (it *LazyRegex) FullString() (detail string)
- func (it *LazyRegex) HasAnyIssues() bool
- func (it *LazyRegex) HasError() bool
- func (it *LazyRegex) IsApplicable() bool
- func (it *LazyRegex) IsCompiled() bool
- func (it *LazyRegex) IsDefined() bool
- func (it *LazyRegex) IsFailedMatch(comparing string) bool
- func (it *LazyRegex) IsFailedMatchBytes(comparingBytes []byte) bool
- func (it *LazyRegex) IsInvalid() bool
- func (it *LazyRegex) IsMatch(comparing string) bool
- func (it *LazyRegex) IsMatchBytes(comparingBytes []byte) bool
- func (it *LazyRegex) IsNull() bool
- func (it *LazyRegex) IsUndefined() bool
- func (it *LazyRegex) MatchError(matchingPattern string) error
- func (it *LazyRegex) MatchUsingFuncError(comparing string, matchFunc RegexValidationFunc) error
- func (it *LazyRegex) MustBeSafe()
- func (it *LazyRegex) OnRequiredCompiled() error
- func (it *LazyRegex) OnRequiredCompiledMust()
- func (it *LazyRegex) Pattern() (pattern string)
- func (it *LazyRegex) String() (pattern string)
- type RegexValidationFunc
Constants ¶
This section is empty.
Variables ¶
var ( WhitespaceFinderRegex = New.Lazy(regconsts.AllWhitespaces) HashCommentWithSpaceOptionalRegex = New.Lazy(regconsts.HashCommentWithSpaceOptional) WhitespaceOrPipeFinderRegex = New.Lazy(regconsts.AllWhitespacesOrPipe) DollarIdentifierRegex = New.Lazy(regconsts.EachWordsWithDollarSymbolDefinition) PercentIdentifierRegex = New.Lazy(regconsts.EachWordsWithinPercentSymbolDefinition) PrettyNameRegex = New.Lazy(regconsts.PrettyName) ExactIdFieldMatchingRegex = New.Lazy(regconsts.ExactIdFieldMatching) ExactVersionIdFieldMatchingRegex = New.Lazy(regconsts.ExactVersionIdFieldMatching) UbuntuNameCheckerRegex = New.Lazy(regconsts.UbuntuNameChecker) CentOsNameCheckerRegex = New.Lazy(regconsts.CentOsNameChecker) RedHatNameCheckerRegex = New.Lazy(regconsts.RedHatNameChecker) FirstNumberAnyWhereCheckerRegex = New.Lazy(regconsts.FirstNumberAnyWhere) WindowsVersionNumberCheckerRegex = FirstNumberAnyWhereCheckerRegex )
var (
New = newCreator{}
)
Functions ¶
func Create ¶ added in v1.3.34
Create creates regex if not already exist in dictionary.
if any error then doesn't save to map and returns the error
func CreateApplicableLock ¶ added in v1.3.34
func CreateApplicableLock(regularExpressionPattern string) ( regEx *regexp.Regexp, err error, isApplicable bool, )
CreateApplicableLock
calls Create with mutex lock and unlock.
func CreateLock ¶ added in v1.3.34
CreateLock calls Create with mutex lock and unlock.
func CreateLockIf ¶ added in v1.3.34
CreateLockIf calls Create with mutex lock and unlock if true.
func CreateMust ¶ added in v1.3.34
CreateMust creates regex if not already exist in dictionary.
if any error then panics
func CreateMustLockIf ¶ added in v1.3.34
func IsMatchFailed ¶ added in v0.8.0
IsMatchFailed creates new regex using lock and then calls match if doesn't match returns true
func IsMatchLock ¶ added in v0.7.6
IsMatchLock creates new regex using lock and then calls match if doesn't match or invalid regex then returns false.
func MatchError ¶ added in v0.9.5
MatchError
creates new regex using without lock (use in vars) and then calls match. On condition mismatch returns error or else nil
func MatchErrorLock ¶ added in v0.7.6
MatchErrorLock
creates new regex using lock and then calls match. On condition mismatch returns error or else nil
func MatchUsingCustomizeErrorFuncLock ¶ added in v0.9.5
func MatchUsingCustomizeErrorFuncLock( regexPattern, comparing string, matchFunc RegexValidationFunc, customizeErrFunc CustomizeErr, ) error
MatchUsingCustomizeErrorFuncLock
creates new regex using lock and then calls match. On condition mismatch returns error or else nil
func MatchUsingFuncErrorLock ¶ added in v0.9.5
func MatchUsingFuncErrorLock( regexPattern, comparing string, matchFunc RegexValidationFunc, ) error
MatchUsingFuncErrorLock
creates new regex using lock and then calls match. On condition mismatch returns error or else nil
func NewMustLock ¶
Types ¶
type CustomizeErr ¶ added in v0.9.5
type LazyRegex ¶ added in v1.3.34
type LazyRegex struct {
// contains filtered or unexported fields
}
LazyRegex
lazy regex for future unwrapping or compiled but only once.
func (*LazyRegex) CompileMust ¶ added in v1.3.34
func (*LazyRegex) CompiledError ¶ added in v1.3.34
func (*LazyRegex) FirstMatchLine ¶ added in v1.3.34
func (*LazyRegex) FullString ¶ added in v1.3.34
func (*LazyRegex) HasAnyIssues ¶ added in v1.3.34
func (*LazyRegex) IsApplicable ¶ added in v1.3.34
IsApplicable
it unwraps the regex and compiles so take memory for once.
func (*LazyRegex) IsCompiled ¶ added in v1.3.34
func (*LazyRegex) IsFailedMatch ¶ added in v1.3.34
func (*LazyRegex) IsFailedMatchBytes ¶ added in v1.3.34
func (*LazyRegex) IsMatchBytes ¶ added in v1.3.34
func (*LazyRegex) IsUndefined ¶ added in v1.3.34
func (*LazyRegex) MatchError ¶ added in v1.3.34
func (*LazyRegex) MatchUsingFuncError ¶ added in v1.3.34
func (it *LazyRegex) MatchUsingFuncError( comparing string, matchFunc RegexValidationFunc, ) error
MatchUsingFuncError
creates new regex using lock and then calls match. On condition mismatch returns error or else nil
func (*LazyRegex) MustBeSafe ¶ added in v1.3.34
func (it *LazyRegex) MustBeSafe()
func (*LazyRegex) OnRequiredCompiled ¶ added in v1.3.34
func (*LazyRegex) OnRequiredCompiledMust ¶ added in v1.3.34
func (it *LazyRegex) OnRequiredCompiledMust()
Source Files
¶
- Create.go
- CreateApplicableLock.go
- CreateLock.go
- CreateLockIf.go
- CreateMust.go
- CreateMustLockIf.go
- IsMatchFailed.go
- IsMatchLock.go
- LazyRegex.go
- MatchError.go
- MatchErrorLock.go
- MatchUsingCustomizeErrorFuncLock.go
- MatchUsingFuncErrorLock.go
- NewMustLock.go
- funcs.go
- lazyRegexMap.go
- newCreator.go
- newLazyRegexCreator.go
- prettyJson.go
- regExMatchValidationError.go
- regexes-compiled.go
- vars.go