[R] Regex - subsetting parts of a file name.

S Ellison S.Ellison at LGCGroup.com
Thu Jul 31 17:09:15 CEST 2014

> I want to keep only the part inside the two points. After lots of headache
> using grep() when trying something like this:
> grep('.(.*?).','df.subject_test.RData',value=T)
> Does anyone have any suggestion ?

gsub("df\\.(.+)\\.RData", "\\1", 'df.subject_test.RData')

Steve E

This email and any attachments are confidential. Any use...{{dropped:8}}

More information about the R-help mailing list