R में Intermediate Regular Expressions
Angelo Zehr
Data Journalist
"...दुकान पहुँचे। बहुत स्मूद और सीmless अनुभव। बढ़िया वैल्यू। मैं ABC Enterprises की जोरदार सिफारिश करूँगा और मैं ज़रूर वापस आऊँगा! अगला, हम गए..."
एक शब्द: (\\w+\\s), 0 से 10 शब्द: (\\w+\\s){0,10}
str_extract_all(
blog_post,
pattern = "(\\w+\\s){0,10}ABC Enterprises\\s?(\\w+\\s){0,10}"
)
रिटर्न्स:
"I would highly recommend ABC Enterprises and I will be coming back for"
"...दुकान पहुँचे। बहुत स्मूद और सीmless अनुभव। बढ़िया वैल्यू। मैं ABC Enterprises की जोरदार सिफारिश करूँगा और मैं ज़रूर वापस आऊँगा! अगला, हम गए..."
निकाला गया:
"I would highly recommend ABC Enterprises and I will be coming back for"
\\w+ को [\\w[:punct:]]+ से बदलें
निकाला गया:
"smooth and seamless experience. Great value. I would highly recommend ABC Enterprises and I will be coming back for sure! Next, we "
R में Intermediate Regular Expressions