To find email id and split the domain name from a given list using regular expression in R
Load the data list
Find the email id using grep()
Split the local part and domain name using regmatches()
mailid=c(“abcd789dfg@gmail.com”,”Not @ mail”,”Simply word”,”asdf456@gmail.com”,”@a13.05″)
#To find the mail ID’s
mm=grep(“@[[:alnum:]]+\\.com”,mailid,value=T)
mm
#To split the local part and domian name of the mail ID
regmatches(mm,gregexpr(“@”,mm),invert = T)