Re: [R] help with regexps

2009-10-07 Thread Dieter Menne
Luca Braglia-2 wrote: > > I'd like to match exactly numbers from 1 to 27. > If you feel in masochistic mode, you can do it: b = c("32","3","17","27","28","57","a13") a = c("^([0-9]|[0-1][0-9]|2[0-7])$") grep(a,b,value=TRUE) A much more flexible way would be to isolate the numeric part firs

[R] help with regexps

2009-10-07 Thread Luca Braglia
Hello everybody I'd like to match exactly numbers from 1 to 27. I've tried a character class like [1-27], but it matches 1,2 and 7. How to tell R (pcre) to interpret 27 "correctly"? Have been fastly looking throughout pcre man pages, without success. Many thanks Luca ___