Skip to content

Commit

Permalink
Fix term-prefix validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert221 committed Oct 24, 2023
1 parent ea5e4a8 commit cbe3b72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/poe.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
SilenceUsage: true,
RunE: runPoe,
}
termPrefixRegexp = regexp.MustCompile("[a-z]*")
termPrefixRegexp = regexp.MustCompile("[a-zA-Z]*")
)

const (
Expand Down Expand Up @@ -160,8 +160,8 @@ func validatePoeOptions(options *poeOptions) []error {
errs = append(errs, errors.New("no POEditor API token provided"))
}

if termPrefixRegexp.MatchString(options.TermPrefix) {
errs = append(errs, errors.New("term prefix must contain only lowercase letters or be empty"))
if !termPrefixRegexp.MatchString(options.TermPrefix) {
errs = append(errs, errors.New("term prefix must contain only letters or be empty"))
}

return errs
Expand Down

0 comments on commit cbe3b72

Please sign in to comment.