我正在尝试将html文件中的电子邮件地址替换为ANTI SPAM格式,然后再次将其导出为nospam.html文件。我尝试使用gsub()函数执行此操作,但是它似乎不起作用。有什么问题?谢谢!!!
datei <- scan("https://isor.univie.ac.at/about-us/People.html", sep = "\n", what= "character")
#pattern.email <- "[a-z]+[.]+[a-z]+?[@]+[a-z]+"
reg.email <- "\\<[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\>" #works
stelle.email <-gregexpr(reg.email, datei, ignore.case = TRUE) #works
unlist(stelle.email)
res.email<- regmatches(datei, stelle.email)
datei2<-gsub(reg.email, "vornameDOTnameNO-SPAMunivieDOTacDOTat", x = datei)
write(datei2, file = "nospam.html")
我正在尝试将html文件中的电子邮件地址替换为ANTI SPAM格式,然后再次将其导出为nospam.html文件。我尝试使用gsub()函数执行此操作,但是它似乎不起作用。 ...
知道regmatches
(对于extracting