Skip to content
Back to formatted view

Raw Message

Message-ID: <alpine.LNX.2.00.1301210733340.30221@salmo.appl-ecosys.com>
Date: 2013-01-21T15:35:18Z
From: Rich Shepard
Subject: Regex for ^ (the caret symbol)?
In-Reply-To: <CAOF_sWQ+XYjA2_Q2h=5hCW_xo7XifhZQwzaHUgReBucKJzkJ2g@mail.gmail.com>

On Mon, 21 Jan 2013, mtb954 at 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 next character is
a literal and not, in this case, the beginning of the line. Try \^ in your
statement.

Rich