Wacek Kusnierczyk wrote: > Duncan Murdoch wrote: > >>>>> Here's a quick hack to achieve the impossible: >>>>> >>>> That might solve John's problem, but I doubt it. As far as I can see >>>> it won't handle \L, for example. >>>> >>>> >>> well, it was not supposed to. it addresses the need for doubling >>> backslashes when a backslash character is an element of the regex. >>> >> \L could be an element of a regex in Perl. >> >>
you should perhaps specify what you mean by 'could be an element of a regular expression'. there is a difference between a regular expression and a string specifying it. in /\LA/, i'd say the string between the slashes contains three characters, but the regex contains just one; there is no \L in the regex, and no backslash either. in /\\LA/, i'd say the string contains four characters, but the regex just three; there is a backslash there, but no \L. just try qr/\L/ (that's an empty pattern), qr/\LA/ (that's a one-character pattern equivalent to qr/a/), and qr/\\LA/. in a sense, \L is just a macro used in constructing regexes, but it has no place in a regex. in this view, "\LA" and "a" are two dstinct strings specifying the same regex (try qr/\LA/ eq qr/a/). vQ ______________________________________________ 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.