KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a character string and what to extract the information inside of multiple parentheses. Currently I can extract the information from the last parenthesis with the code below. How would I do it so it extracts multiple parentheses and returns as a vector? j <- "What kind of cheese isn't your cheese? (wonder) Nacho cheese! (groan) (Laugh)" sub("\\).*", "", sub(".*\\(", "", j)) Current output is: [1] "Laugh" Desired output is: [1] "wonder" "groan" "Laugh"
Tags (comma-separated)
Save Edits
Cancel