Loading ...
Sorry, an error occurred while loading the content.

Re: PHPNuke blocks and javascript encoding

Expand Messages
  • Sheri
    ... of ... not ... Hi Bob, You re quite right, it has the same effect whether the backslash is in either position or omitted entirely and usually it is only
    Message 1 of 12 , Jun 15, 2006
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Bob McAllister" <fortiter@...>
      wrote:
      >
      > On 6/15/06, Sheri <silvermoonwoman@...> wrote:
      > >
      > > Bob, your replace string needs the backslash moved to be in front
      of
      > > the dot.
      > >
      > > Regards,
      > > Sheri
      > >
      >
      > Sheri
      >
      > In my line ^!Replace "^." >> "$content .= \"&" rhas, I thought that
      > the slash was escaping the quote inside the replace string. I do
      not
      > see a purpose for placing it before the "dot". Can you explain?
      >
      > From my exploration, it seems that the clip has the same effect
      > whether the backslash is in either position (or omitted entirely!).
      >
      > Bob
      >

      Hi Bob,

      You're quite right, it has the same effect whether the backslash is
      in either position or omitted entirely and usually it is only
      necessary to escape metacharacters in the search string, not the
      replacement string. The backslash character itself is an exception
      (you would need two in the replacement string to get a literal
      backslash in your output). But the purpose of escaping other
      characters with the backslash is to reference the literal character
      and not the metacharacter. Dot is a metacharacter while doublequote
      is not. So while in this case the backslash is not needed, it would
      make more sense in front of the dot than the doublequote. Using a
      backslash where it is not needed in replacement clause can cause
      wrong results, but probably only when misplaced in front of an alpha
      character like n or t (with backslash would be interpreted as line
      break or tab), or a number like 1 or 2 (would be interpreted as a
      tagged match if there is a matching set of curly braces in the search
      string - otherwise neither than backslash nor the number would show
      up in the output). Hope this makes some sense to you. :D

      Regards,
      Sheri
    Your message has been successfully submitted and would be delivered to recipients shortly.