Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed Nov 26, 2018
1 parent b12b5ff commit 13b7ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions str/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func IsMail(s string) bool {

func IsPhone(s string) bool {
if strings.HasPrefix(s, "+") {
return IsMatch(s[1:], `\d{13}`)
return IsMatch(s[1:], `^\d{13}$`)
} else {
return IsMatch(s, `\d{11}`)
return IsMatch(s, `^\d{11}$`)
}
}

Expand Down

0 comments on commit 13b7ce6

Please sign in to comment.