Skip to content
Prev 273437 / 398506 Next

help with regexp

Hi Jannis,
just use the backreferences in gsub, see ?gsub, -> replacement

test <- c('filename_1_def.pdf', 'filename_2_abc.pdf')
gsub(".*_([A-z]+)\\.pdf", "\\1", test)

hth.

Am 05.10.2011 13:56, schrieb Jannis: