regexnew

package
v0.7.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WhitespaceFinderRegex             = NewMust(regconsts.AllWhitespaces)
	HashCommentWithSpaceOptionalRegex = NewMust(regconsts.HashCommentWithSpaceOptional)
	WhitespaceOrPipeFinderRegex       = NewMust(regconsts.AllWhitespacesOrPipe)
	DollarIdentifierRegex             = NewMust(regconsts.EachWordsWithDollarSymbolDefinition)
	PercentIdentifierRegex            = NewMust(regconsts.EachWordsWithinPercentSymbolDefinition)
)

Functions

func IsMatchLock added in v0.7.6

func IsMatchLock(regex, comparing string) bool

IsMatchLock creates new regex using lock and then calls match if doesn't match or invalid regex then returns false.

func MatchErrorLock added in v0.7.6

func MatchErrorLock(regex, comparing string) error

MatchErrorLock creates new regex using lock and then calls match if doesn't match then returns error

func New

func New(regularExpressionSyntax string) (*regexp.Regexp, error)

New creates regex if not already exist in dictionary.

if any error then doesn't save to map and returns the error

func NewLock

func NewLock(regularExpressionSyntax string) (*regexp.Regexp, error)

NewLock calls New with mutex lock and unlock.

func NewLockIf added in v0.6.9

func NewLockIf(isLock bool, regularExpressionSyntax string) (*regexp.Regexp, error)

NewLockIf calls New with mutex lock and unlock if true.

func NewMust

func NewMust(regularExpressionSyntax string) *regexp.Regexp

NewMust creates regex if not already exist in dictionary.

if any error then panics

func NewMustLock

func NewMustLock(regularExpressionSyntax string) *regexp.Regexp

func NewMustLockIf added in v0.6.9

func NewMustLockIf(
	isLock bool,
	regularExpressionSyntax string,
) *regexp.Regexp

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL