Let's say I wanted to extract a string found between two defined strings. For example, the function,we'll call it parse_between()
would work as follows in R:
>main_string<-"the quick brown fox>$ jumps over the lazy </ dog"
>substring<-parse_between(main_string, begin=">$", end="</")
>substring
[1] " jumps over the lazy "
Even better if it could produce a vector with elements corresponding to each instance. I've searched some of the packages available for string manipulation like "stringr" but have not found a function to do this as easily as the example shows. My motivation is to parse html files unfortunately despite searching I haven't found an html parser for R.