I want to match the right phone number from a string. For example:
string := "my phone number is 15817452367"
re := regexp.MustCompile(`1[34578][0-9]{9}`)
re.FindAllString(string, -1)
-> 15817452367
This result is right, but for another string:
string := "my card number is 115817452367"
re := regexp.MustCompile(`1[34578][0-9]{9}`)
re.FindAllString(string, -1)
-> 15817452367 (invalid)
This regex also matches the phone number, but I want this to not be a valid value,I don't want to get a phone number form a digital string. How can I fix the regex? Thanks in advance!