regex - Find rows that contain three digit number -


i need subset rows contain <three digit number>
wrote

foo <- grepl("<^[0-9]{3}$>", log1[,2]) others <- log1[!foo,] 

but i'm not sure how use regex...just been using cheat sheets , google. think < , > characters throwing off.

the ^ , $ signs refer beginning , end of string, respectively. shouldn't matching before or after them.

if want rows contain pattern, shouldn't use anchors @ all. should use this: <[0-9]{3}> (or shorten <\\d{3}>)


Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -