xxxxxxxxxx
/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
xxxxxxxxxx
// This is by far the best regex used for email
^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$
xxxxxxxxxx
package main
import (
"fmt"
"regexp"
)
func IsValidPhoneEmail(value interface{}) bool {
var (
phonePattern string = `^\+?[0-9]\d{1,20}$`
emailPattern string = `^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-]+)(\.[a-zA-Z]{2,5}){1,2}$`
)
if isPhoneMatch, _ := regexp.MatchString(phonePattern, fmt.Sprintf("%v", value)); isPhoneMatch {
return true
} else if isEmailMatch, _ := regexp.MatchString(emailPattern, fmt.Sprintf("%v", value)); isEmailMatch {
return true
}
return false
}
func main() {
// pattern := `^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-]+)(\.[a-zA-Z]{2,5}){1,2}$`
// data := "jamal13@gmail.com"
isMatch := IsValidPhoneEmail(nil)
fmt.Println(isMatch)
}
xxxxxxxxxx
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
xxxxxxxxxx
//Provided by Youtube: CodingBite
let email='hello@example.com'
const handleSubmit = () => {
let mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
let Email = email.trimLeft()
Email != ''
? Email.match(mailformat)
? alert('Sucess')
: alert('Enter Correct Mail!')
: alert('Fill email first!')
}
xxxxxxxxxx
^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
xxxxxxxxxx
apt install -t bookworm-backports linux-image-amd64 linux-headers-amd64