Skip to content
Prev 59377 / 398502 Next

how to get to interesting part of pattern match

Vadim Ogranovich wrote:

            
what about:

gsub(".*[./](*.)", "\\1", "abc/foo")

output-start
[1] "foo"
output-end

or try:

strsplit("abc/foo","/")[[1]][2]

output-start
[1] "foo"
output-end

Peter Wolf