[R] Regex for ^ (the caret symbol)?

S Ellison S.Ellison at LGCGroup.com
Tue Jan 22 12:23:46 CET 2013


 

> -----Original Message-----
> > So what is the special behavior of the ^ symbol when not at 
>> the beginning of the string that occurs when it is not escaped?
> 
> I think it retains its meaning as an assertion that it occurs 
> at the beginning of the line, and so a pattern like "a^b" 
> could never match anything.  

... unless a or b are newlines and you are matching multi-line expressions, when ^ and $ match before and after line breaks as well as beginning and end of string.

S Ellison

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list