use regex in R to parse a string -


i have string this:

vmstat_webserver01.20130102 

i need use regex pick value between "_" , "."

i tried this:

grep("(_.*)+.", name, value=true) 

did not work pointers?

you can gsub():

name <- 'vmstat_webserver01.20130102' gsub('.*_(.*)\\..*', '\\1', name) 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -