[R] R Regular Expressions - Metacharacters

2013-02-05 Thread Seth Dickey
I thought that I can use metacharacters such as \w to match word characters with one backslash. But for some reason, I need to include two backslashes. grepl(pattern='\w', x=what) Error: '\w' is an unrecognized escape in character string starting \w grepl(pattern='\\w', x=what) [1] TRUE I

Re: [R] R Regular Expressions - Metacharacters

2013-02-05 Thread Duncan Murdoch
On 05/02/2013 12:49 PM, Seth Dickey wrote: I thought that I can use metacharacters such as \w to match word characters with one backslash. But for some reason, I need to include two backslashes. grepl(pattern='\w', x=what) Error: '\w' is an unrecognized escape in character string starting \w

Re: [R] R Regular Expressions - Metacharacters

2013-02-05 Thread David Winsemius
On Feb 5, 2013, at 9:49 AM, Seth Dickey wrote: I thought that I can use metacharacters such as \w to match word characters with one backslash. But for some reason, I need to include two backslashes. grepl(pattern='\w', x=what) Error: '\w' is an unrecognized escape in character string