[R] case insensitive regular expression

From: JeeBee <JeeBee_at_troefpunt.nl>
Date: Mon 05 Jun 2006 - 23:16:34 EST


Can anybody fix the following, to match a string disregarding case?

I tried:
with(my.data.frame, regexpr(pattern = '(?i)J\. Test',   text=TARGET_COLUMN), perl=T) != -1)

R yields: invalid regular expression

with(my.data.frame, regexpr(pattern = 'J\. Test',   text=TARGET_COLUMN), perl=T) != -1)
works, but it does not match "J. TEST".
It does match "J. Test" correctly.

I have the feeling I'm not reading the documentation good enough, but cannot seem to figure this out, sorry.

Thanks in advance,
JeeBee.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 05 23:30:08 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 06 Jun 2006 - 00:10:37 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.