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 first, and
test for the range in a seconde step.
Dieter
--
View this message in context:
http://www.nabble.com/help-with-regexps-tp25783202p25783948.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.