Closed johnny-silverhand closed 5 years ago
Since the email regular expression never changes, you could actually compile the regular expression before hand and use the compiled regular expression as a an argument to the MatchRegexp function.
Example:
var (
emailReg := regexp.MustCompile("[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}")
)
...
func MatchEmail() MatcherFunc {
return MatchRegexp(emailReg)
}
This will eliminate the need to recompile the regular expression every time the MatchEmail function is called.
Hi @dapryor Thank you for your reply. Yeah, it's obviously my mistake. Will be fixed soon
Codecov Report
100% <100%> (ø)
Continue to review full report at Codecov.