-5
我有一個輸入文本提取字符串匹配後 - 正則表達式[R
inputQ <- "What can I do ..my baby has rash all over. Suggest good rash cream"
我的術語列表
terms <- c("diaper","cloth diaper","rash pants","rash","baby wipes","rash cream")
我想精確匹配的條件之一,並返回它以及 我嘗試使用for循環,但有沒有更好的方法
結果應該是
rash cream
存儲在matchedTerm
爲什麼要「疹膏」,而不是「疹「 回?你嘗試了什麼? –
*我希望完全匹配其中一個術語* ...哪一個? – Sotos
可能的重複http://stackoverflow.com/questions/33856148/regex-in-r-extracting-words-from-a-string或http://stackoverflow.com/questions/33784376/extract-word-in-字符串在-R – akrun