Re: [R] Extract word from string based on pattern match

2016-10-24 Thread Ista Zahn
On Oct 24, 2016 6:05 PM, "Joe Ceradini" wrote: > > Excellent - thanks David! > Regex syntax never fails to scare the crap out of me :) > > David absolutely solved my problem (in record time, no less), so it > can be put to rest. However, if anyone knows how to accomplish the > same thing through n

Re: [R] Extract word from string based on pattern match

2016-10-24 Thread Joe Ceradini
Excellent - thanks David! Regex syntax never fails to scare the crap out of me :) David absolutely solved my problem (in record time, no less), so it can be put to rest. However, if anyone knows how to accomplish the same thing through non base packages, like stringr or stringi, I'd be interested

[R] Extract word from string based on pattern match

2016-10-24 Thread Joe Ceradini
R Helpers, I would like to extract the entire word beginning with "BT" (or "BT-") and not any thing else in the string. Or, I would like to extract from BT up until the next space. test <- data.frame(x = c("abc", "Sample BT-1501-2E stuff", "Bt-1599-3E stuff")) test So, from test$x I would like t