Compare commits

..

No commits in common. "master" and "v0.9.0-beta.1" have entirely different histories.

2 changed files with 2 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import (
) )
const ( const (
aliasRegex = `^(?i)[a-z][a-z0-9]*(\.[a-z0-9]+)*$` aliasRegex = `^[a-zA-Z0-9]+(\.[a-zA-Z0.9]+)*$`
) )
// IsValidAlias checks if the alias is a valid alias format // IsValidAlias checks if the alias is a valid alias format

View File

@ -9,9 +9,7 @@ import (
// Define the regex patterns as constants // Define the regex patterns as constants
const ( const (
// TODO: This should rather use a phone package to determine whether valid phone number for any region. // TODO: This should rather use a phone package to determine whether valid phone number for any region.
// Kenyan phone numbers: must be exactly 10 digits (07XXXXXXXX or 01XXXXXXXX) when starting with 0 phoneRegex = `^(?:\+254|254|0)?((?:7[0-9]{8})|(?:1[01][0-9]{7}))$`
// Or start with 254 / +254 and still follow the same pattern
phoneRegex = `^(?:\+254|254|0)(7\d{8}|1[01]\d{7})$`
) )
// IsValidPhoneNumber checks if the given number is a valid phone number // IsValidPhoneNumber checks if the given number is a valid phone number