[R] Escaping regular expressions

Hadley Wickham hadley at rice.edu
Fri Nov 13 14:33:55 CET 2009


Hi all,

Is there a method for escaping strings to be used regular expressions?
 i.e. if I have a user supplied string that I'd like to use as a fixed
component is there a method that will turn (e.g.) ".$^" into
"\\.\\$\\^" ?

Thanks,

Hadley

-- 
http://had.co.nz/




More information about the R-help mailing list