R 중급 정규 표현식
Angelo Zehr
Data Journalist
"...가게에 도착했다. 매우 부드럽고 끊김 없는 경험. 훌륭한 가치. 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"
"...가게에 도착했다. 매우 부드럽고 끊김 없는 경험. 훌륭한 가치. 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 중급 정규 표현식