[R] regex - extracting 2 numbers and " from strings

Omar André Gonzáles Díaz oma.gonzales at gmail.com
Fri Oct 9 00:45:13 CEST 2015


Hi I have a vector of 100 elementos like this ones:

a <- c("SMART TV LCD FHD 70\" LC70LE660", "LED FULL HD 58'' LE58D3140")

I want to put just the (70\") and (58'') in a vector b.

This is my try, but is not working:

b <- grepl('^[0-9]{2}""$',a)

Any hint is welcome, thanks.

	[[alternative HTML version deleted]]



More information about the R-help mailing list