[R] case insensitive regular expression

JeeBee JeeBee at troefpunt.nl
Mon Jun 5 15:16:34 CEST 2006


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.



More information about the R-help mailing list