[R] Backslash

From: Josef Eschgfaeller <esg_at_felix.unife.it>
Date: Mon 23 May 2005 - 19:46:09 EST

Why sometimes one has to put a double
backslash in regular expressions, but
often simple backslashes work too?

Is only a \ required for giving a
metacharacter its usual meaning?



u=grep('\\{[\\-u]x',a,perl=T)

# equivalent to

u=grep('\{[\-u]x',a,perl=T)

# but

u=grep('\w',a,perl=T)

# is not correct and requires

u=grep('\\w',a,perl=T)



Josef Eschgfäller
-- 
Josef Eschgfäller
Dipartimento Matematico
Universita' di Ferrara
http://felix.unife.it


______________________________________________ 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 May 23 20:02:10 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:00 EST