|
|
@ -51,10 +51,11 @@ func ValidateWwff(inputStr string) (ref, errorMsg string) {
|
|
|
|
return wrongInputStr, errorMsg
|
|
|
|
return wrongInputStr, errorMsg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var validPotaRegexp = regexp.MustCompile(`^[\d]{0,1}[A-Z]{1,2}-[\d]{4,5}$`)
|
|
|
|
var validPotaRegexp = regexp.MustCompile(`^[\d]{0,1}[A-Z]{1,2}[\d]{0,1}-[\d]{4,5}$`)
|
|
|
|
|
|
|
|
|
|
|
|
// ValidatePota verifies whether the supplied string is a valid POTA reference.
|
|
|
|
// ValidatePota verifies whether the supplied string is a valid POTA reference.
|
|
|
|
// The syntax is: AA-CCCCC: AA = national prefix, CCCCC = 4 or 5-digit numeric code (e.g. ON-00001).
|
|
|
|
// The syntax is: AA-CCCCC: AA = national prefix, CCCCC = 4 or 5-digit numeric code (e.g. ON-00001).
|
|
|
|
|
|
|
|
// Note that the national prefix can start with a number, must have 1 or 2, and can end with a number
|
|
|
|
func ValidatePota(inputStr string) (ref, errorMsg string) {
|
|
|
|
func ValidatePota(inputStr string) (ref, errorMsg string) {
|
|
|
|
inputStr = strings.ToUpper(strings.TrimSpace(inputStr))
|
|
|
|
inputStr = strings.ToUpper(strings.TrimSpace(inputStr))
|
|
|
|
wrongInputStr := "*" + inputStr
|
|
|
|
wrongInputStr := "*" + inputStr
|
|
|
|