Skip to content
Prev 315761 / 398506 Next

Regex for ^ (the caret symbol)?

I am not sure I understand what worked perfectly, since it is my understanding that ^ is only special at the beginning of the regex (to anchor the pattern at the beginning of the target string) or as the first character of a character set (to indicate exclusion of the listed characters). In any other position the caret should behave like an ordinary character. That is, your original pattern should have worked as-is. This is supported by the help page documentation for regex in the paragraph below the definition of [:xdigit:]. I think this is a bug in R.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
mtb954 at gmail.com wrote: