-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
Hello R-helpers,
I am trying to search for string that includes the caret symbol, using the
following code:
grepl(latitude^2,temp)
And R doesn't like that. It gives me:
temp-c(latitude^2,latitude and latitude^2,longitude^2,longitude
and longitude^2)
temp
[1] latitude^2
Hi Mark Na,
Try:
grepl(latitude\\^2,temp)
^ is a control character for negation, so you have to escape it.
Cheers,
Tsjerk
On Mon, Jan 21, 2013 at 4:26 PM, mtb...@gmail.com wrote:
Hello R-helpers,
I am trying to search for string that includes the caret symbol, using the
following code:
Oh, I'm jetlagged. ^ is a control character for 'start of string'. In the
context of a character set it means negation: [^a-z].
Ciao,
Tsjerk
On Mon, Jan 21, 2013 at 4:33 PM, Tsjerk Wassenaar tsje...@gmail.com wrote:
Hi Mark Na,
Try:
grepl(latitude\\^2,temp)
^ is a control character for
Hi Tsjerk, many thanks...that worked perfectly!
Mark Na
On Mon, Jan 21, 2013 at 9:36 AM, Tsjerk Wassenaar tsje...@gmail.com wrote:
Oh, I'm jetlagged. ^ is a control character for 'start of string'. In the
context of a character set it means negation: [^a-z].
Ciao,
Tsjerk
On Mon, Jan
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
On Mon, 21 Jan 2013, mtb...@gmail.com wrote:
I am trying to search for string that includes the caret symbol, using the
following code:
grepl(latitude^2,temp)
Many regex implementations require us to escape a metacharacter such as
'^' by preceeding it with a backslash. This indicates the
On 13-01-21 11:48 AM, Jeff Newmiller wrote:
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
So what is the special behavior of the ^ symbol when not at the beginning of
the string that occurs when it is not escaped?
---
Jeff NewmillerThe . . Go Live...
On Jan 21, 2013, at 10:05 AM, Jeff Newmiller wrote:
So what is the special behavior of the ^ symbol when not at the
beginning of the string that occurs when it is not escaped?
Isn't there a distinction between what _is_ special and what should
be special. You are saying that ^ after the
On 13-01-21 1:05 PM, Jeff Newmiller wrote:
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
Apparently Extended RegExp syntax eliminated the
^-is-an-ordinary-character-except-for-two-uses meaning that I am familiar
with from the Basic RegExp usage, since GNU grep with the -e option also
refuses to match the carat unless it is escaped. The TRE library treats BRE as
obsolete, so we
On 13-01-21 3:20 PM, Jeff Newmiller wrote:
Apparently Extended RegExp syntax eliminated the
^-is-an-ordinary-character-except-for-two-uses meaning that I am familiar with from the
Basic RegExp usage, since GNU grep with the -e option also refuses to match the carat unless it is
escaped. The
Hello,
Em 21-01-2013 20:52, Duncan Murdoch escreveu:
On 13-01-21 3:20 PM, Jeff Newmiller wrote:
Apparently Extended RegExp syntax eliminated the
^-is-an-ordinary-character-except-for-two-uses meaning that I am
familiar with from the Basic RegExp usage, since GNU grep with the -e
option also
14 matches
Mail list logo